// check-pass // From https://github.com/rust-lang/rust/issues/72476 // and https://github.com/rust-lang/rust/issues/89393 trait Trait { type Projection; } struct A; impl Trait for A { type Projection = bool; } struct B; impl Trait for B { type Projection = (u32, u32); } struct Next(T::Projection); fn foo1(item: Next) { match item { Next(true) => {} Next(false) => {} } } fn foo2(x: ::Projection) { match x { true => {} false => {} } } fn foo3(x: Next) { let Next((_, _)) = x; match x { Next((_, _)) => {} } } fn foo4(x: ::Projection) { let (_, _) = x; match x { (_, _) => {} } } fn foo5(x: ::Projection) { match x { _ => {} } } fn main() {}