You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of rust-lang#136303 - lcnr:elaborate-skip-bad-projections, r=<try>
elaborate: avoid projections with unconstrained bound regions
Should only do this for where-bounds and item bounds. Gonna rewrite later I think.
This means we'll no longer need to support unconstrained regions in implied bounds, see lcnr/random-rust-snippets#15. This fixes
```rust
trait Super {
type SAssoc;
}
trait Trait<'a>: Super<SAssoc = <Self as Trait<'a>>::TAssoc> {
type TAssoc;
}
fn test<'a, T: 'a>() {}
fn unconstrained_lt<'arg, T: for<'a> Trait<'a>>(x: &'arg <T as Super>::SAssoc) {
test::<'arg, <T as Super>::SAssoc>();
}
```
but breaks
```rust
trait Super {
type SAssoc;
}
trait Trait<'a>: Super<SAssoc = <Self as Trait<'a>>::TAssoc> {
type TAssoc;
}
fn test<'a, T: 'a>() {}
fn unconstrained_lt<'arg, T: for<'a> Trait<'a, TAssoc = usize>>(x: <T as Super>::SAssoc) -> usize {
x
}
```
r? `@compiler-errors`
0 commit comments