default auto traits: use default supertraits instead of Self: Trait bounds on associated items by Bryanskiy · Pull Request #145879 · rust-lang/rust (original) (raw)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my understanding there are 2 checks for relaxed bounds consistency:
- Syntactic check during AST->HIR lowering (
validate_relaxed_bound) to ensure that?Traitbounds are in a right place. - Semantic check during HIR->ty lowering (
check_and_report_invalid_relaxed_bounds) to ensure that?modifier is applied to "right" traits. And this check has to be done regardless of the place and results of the first check.
This PR fixes the first check but not the second and therefore FIXME comments in this file are still relevant.
So, your suggestion is to keep these checks in separate files for readability reasons, right? In my opinion it isn't very useful because the invocation of second check implies that the first check has already been invoked. That is, the test that covers the second check also covers the first one.