rust/compiler/rustc_hir_analysis/src
Michael Goulet d1b43d09e3
Rollup merge of #130666 - compiler-errors:super-bounds, r=fee1-dead,fmease
Assert that `explicit_super_predicates_of` and `explicit_item_super_predicates` truly only contains bounds for the type itself

We distinguish _implied_ predicates (anything that is implied from elaborating a trait bound) from _super_ predicates, which are are the subset of implied predicates that share the same self type as the trait predicate we're elaborating. This was originally done in #107614, which fixed a large class of ICEs and strange errors where the compiler expected the self type of a trait predicate not to change when elaborating super predicates.

Specifically, super predicates are special for various reasons: they're the valid candidates for trait upcasting, are the only predicates we elaborate when doing closure signature inference, etc. So making sure that we get this list correct and don't accidentally "leak" any other predicates into this list is quite important.

This PR adds some debug assertions that we're in fact not doing so, and it fixes an oversight in the effect desugaring rework.
2024-09-21 15:18:58 -04:00
..
check Auto merge of #124895 - obeis:static-mut-hidden-ref, r=compiler-errors 2024-09-20 17:25:34 +00:00
coherence Rollup merge of #130235 - compiler-errors:nested-if, r=michaelwoerister 2024-09-12 20:37:16 +10:00
collect Rollup merge of #130666 - compiler-errors:super-bounds, r=fee1-dead,fmease 2024-09-21 15:18:58 -04:00
errors Explicitly mark a hack as a HACK and elaborate its comment 2024-09-18 19:36:44 +02:00
hir_ty_lowering Rollup merge of #130666 - compiler-errors:super-bounds, r=fee1-dead,fmease 2024-09-21 15:18:58 -04:00
impl_wf_check Remove #[macro_use] extern crate tracing from rustc_hir_analysis. 2024-08-30 17:14:59 +10:00
outlives Remove #[macro_use] extern crate tracing from rustc_hir_analysis. 2024-08-30 17:14:59 +10:00
variance Remove #[macro_use] extern crate tracing from rustc_hir_analysis. 2024-08-30 17:14:59 +10:00
autoderef.rs Remove #[macro_use] extern crate tracing from rustc_hir_analysis. 2024-08-30 17:14:59 +10:00
bounds.rs Don't elaborate effects predicates into bounds list unless we're actually collecting implied bounds, not super bounds 2024-09-21 12:20:40 -04:00
check_unused.rs Remove #[macro_use] extern crate tracing from rustc_hir_analysis. 2024-08-30 17:14:59 +10:00
collect.rs Add missing diagnostics and flesh out tests 2024-09-20 22:18:57 -04:00
constrained_generic_params.rs Remove #[macro_use] extern crate tracing from rustc_hir_analysis. 2024-08-30 17:14:59 +10:00
delegation.rs Delegation: support generics in associated delegation items 2024-09-05 16:04:50 +03:00
errors.rs Add missing diagnostics and flesh out tests 2024-09-20 22:18:57 -04:00
hir_wf_check.rs Remove #[macro_use] extern crate tracing from rustc_hir_analysis. 2024-08-30 17:14:59 +10:00
impl_wf_check.rs Add warn(unreachable_pub) to rustc_hir_analysis. 2024-08-27 13:14:50 +10:00
lib.rs Remove #[macro_use] extern crate tracing from rustc_hir_analysis. 2024-08-30 17:14:59 +10:00