Closed lcnr closed 6 months ago
in the old solver satisfies_trait_bound compiles while satisfies_projection_bound does not.
satisfies_trait_bound
satisfies_projection_bound
trait Trait<'a, 'b> { type Assoc; } trait TraitBound<'b> {} impl<'b, T: for<'a> Trait<'a, 'b>> TraitBound<'b> for T {} trait ProjectionBound<'b> {} impl<'b, T: for<'a> Trait<'a, 'b, Assoc = usize>> ProjectionBound<'b> for T {} impl<'a, T> Trait<'a, 'static> for T { type Assoc = usize; } fn trait_bound<'b, T: TraitBound<'b>>() {} fn projection_bound<'b, T: ProjectionBound<'b>>() {} fn satisfies_trait_bound<T: for<'b> Trait<'static, 'b>>() { trait_bound::<T>() } fn satisfies_projection_bound<T: for<'b> Trait<'static, 'b, Assoc = usize>>() { projection_bound::<T>() } fn main() {}
can be closed. The behavior is now the same for the old and the new solver once https://github.com/rust-lang/rust/pull/119820 has been merged
in the old solver
satisfies_trait_bound
compiles whilesatisfies_projection_bound
does not.