With rust-lang/rust#119101 and rust-lang/rust#120513 TypeOutlives obligations and assumptions are now eagerly normalized at the start of regionck and borrowck.
previous issue
Type-outlives bounds can be proven several ways -- via item bounds, via param-env clauses, and by recursively applying to the type's components. When applying param-env clauses that may satisfy a type-outlives bounds, we use the Match relation, which only considers types structurally.
That causes this code to go from passing to failing in the new trait solver:
trait Mirror {
type Assoc;
}
impl<T> Mirror for T {
type Assoc = T;
}
fn is_static<T: 'static>() {}
fn test<T>() where <T as Mirror>::Assoc: 'static {
is_static::<T>();
}
With rust-lang/rust#119101 and rust-lang/rust#120513
TypeOutlivesobligations and assumptions are now eagerly normalized at the start of regionck and borrowck.previous issue
Type-outlives bounds can be proven several ways -- via item bounds, via param-env clauses, and by recursively applying to the type's components. When applying param-env clauses that may satisfy a type-outlives bounds, we use the
Matchrelation, which only considers types structurally.That causes this code to go from passing to failing in the new trait solver: