1
Fork 0

Auto merge of #120639 - fee1-dead-contrib:new-effects-desugaring, r=oli-obk

Implement new effects desugaring

cc `@rust-lang/project-const-traits.` Will write down notes once I have finished.

* [x] See if we want `T: Tr` to desugar into `T: Tr, T::Effects: Compat<true>`
* [x] Fix ICEs on `type Assoc: ~const Tr` and `type Assoc<T: ~const Tr>`
* [ ] add types and traits to minicore test
* [ ] update rustc-dev-guide

Fixes #119717
Fixes #123664
Fixes #124857
Fixes #126148
This commit is contained in:
bors 2024-06-29 20:08:10 +00:00
commit ba1d7f4a08
175 changed files with 2234 additions and 1576 deletions

View file

@ -4995,6 +4995,12 @@ fn point_at_assoc_type_restriction<G: EmissionGuarantee>(
let ty::ClauseKind::Projection(proj) = clause else {
return;
};
// avoid ICEing since effects desugared associated types don't have names.
// this path should only be hit for `~const` on invalid places, so they
// will have an informative error already.
if tcx.is_effects_desugared_assoc_ty(proj.projection_term.def_id) {
return;
}
let name = tcx.item_name(proj.projection_term.def_id);
let mut predicates = generics.predicates.iter().peekable();
let mut prev: Option<&hir::WhereBoundPredicate<'_>> = None;