pix regression: env is global after normalization impl shadowing · Issue #179 · rust-lang/trait-system-refactor-initiative (original) (raw)
Minimized:
struct NewSolver;
struct OldSolver;
fn foo<T>()
where
T: Iterator<Item = NewSolver>,
OldSolver: Into<T::Item>,
{
let x: OldSolver = OldSolver.into();
}
New solver sees T::Item
in where clause, prefers that b/c it mentions params even though it can be normalized, and chooses the OldSolver: Into<NewSolver>
impl.
Old solver normalizes param-env, so it sees OldSolver: Into<NewSolver>
is global, and chooses the reflexive T: Into<T>
impl.