Make diagnostic for unsatisfied `Termination` bounds more precise
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
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
@bors r+
cc @estebank you're gonna love this I think
:pushpin: Commit 684df4d24ec605a07f1a5789c1d0027d4887103c has been approved by oli-obk
It is now in the queue for this repository.