rust-lang / trait-system-refactor-initiative

The Rustc Trait System Refactor Initiative
21 stars 0 forks source link

Structural equality in method candidate assembly incompatible w/ lazy norm #121

Open compiler-errors opened 2 months ago

compiler-errors commented 2 months ago
trait Mirror {
    type Assoc: ?Sized;
}
impl<T: ?Sized> Mirror for T {
    type Assoc = T;
}

mod w {
    pub(super) trait Trait {
        fn method(&self);
    }
}

fn test<T>(t: T) where <T as Mirror>::Assoc: w::Trait {
    t.method();
}

fn main() {}

https://github.com/rust-lang/rust/blob/53676730146e38e4697b6204c2ee61a9fd6b7e51/compiler/rustc_hir_typeck/src/method/probe.rs#L794