rust icon indicating copy to clipboard operation
rust copied to clipboard

Make diagnostic for unsatisfied `Termination` bounds more precise

Open fmease opened this issue 3 years ago • 1 comments

Don't blindly emit a diagnostic claiming that “main has an invalid return type” if we encounter a type that should but doesn't implement std::process::Termination and isn't actually the return type of the program entry main.

Fixes #103052.

@rustbot label A-diagnostics T-compiler T-libs r? diagnostics

fmease avatar Oct 17 '22 10:10 fmease

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

rustbot avatar Oct 17 '22 10:10 rustbot

@bors r+

cc @estebank you're gonna love this I think

oli-obk avatar Oct 18 '22 09:10 oli-obk

:pushpin: Commit 684df4d24ec605a07f1a5789c1d0027d4887103c has been approved by oli-obk

It is now in the queue for this repository.

bors avatar Oct 18 '22 09:10 bors