pix regression: env is global after normalization impl shadowing · Issue #179 · rust-lang/trait-system-refactor-initiative (original) (raw)

https://crater-reports.s3.amazonaws.com/pr-133502-2/try%23da0a4799770027c4c578bf48cdb390acfde09023/reg/pix-0.14.0/log.txt

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.