#![feature(associated_type_defaults)] trait Tr { type Y = u16; fn Y() {} } impl Tr for u8 {} trait Dr { type X = u16; fn Z() {} } impl Dr for u8 {} enum E { Y } type A = u32; fn main() { let _: ::N; //~ ERROR cannot find associated type `N` in trait `Tr` let _: ::N; //~ ERROR cannot find associated type `N` in enum `E` let _: ::N; //~ ERROR cannot find associated type `N` in `A` ::N; //~ ERROR cannot find method or associated constant `N` in trait `Tr` ::N; //~ ERROR cannot find method or associated constant `N` in enum `E` ::N; //~ ERROR cannot find method or associated constant `N` in `A` let _: ::Y; // OK let _: ::Y; //~ ERROR expected associated type, found variant `E::Y` ::Y; // OK ::Y; //~ ERROR expected method or associated constant, found unit variant `E::Y` let _: ::N::NN; //~ ERROR cannot find associated type `N` in trait `Tr` let _: ::N::NN; //~ ERROR cannot find associated type `N` in enum `E` let _: ::N::NN; //~ ERROR cannot find associated type `N` in `A` ::N::NN; //~ ERROR cannot find associated type `N` in trait `Tr` ::N::NN; //~ ERROR cannot find associated type `N` in enum `E` ::N::NN; //~ ERROR cannot find associated type `N` in `A` let _: ::Y::NN; //~ ERROR ambiguous associated type let _: ::Y::NN; //~ ERROR expected associated type, found variant `E::Y` ::Y::NN; //~ ERROR no associated item named `NN` found for type `u16` ::Y::NN; //~ ERROR expected associated type, found variant `E::Y` let _: ::NN; //~ ERROR cannot find associated type `NN` in `Tr::N` let _: ::NN; //~ ERROR cannot find associated type `NN` in `E::N` let _: ::NN; //~ ERROR cannot find associated type `NN` in `A::N` ::NN; //~ ERROR cannot find method or associated constant `NN` in `Tr::N` ::NN; //~ ERROR cannot find method or associated constant `NN` in `E::N` ::NN; //~ ERROR cannot find method or associated constant `NN` in `A::N` let _: ::NN; //~ ERROR cannot find associated type `NN` in `Tr::Y` let _: ::NN; //~ ERROR failed to resolve: `Y` is a variant, not a module ::NN; //~ ERROR cannot find method or associated constant `NN` in `Tr::Y` ::NN; //~ ERROR failed to resolve: `Y` is a variant, not a module let _: ::Z; //~ ERROR expected associated type, found associated function `Dr::Z` ::X; //~ ERROR expected method or associated constant, found associated type `Dr::X` let _: ::Z::N; //~ ERROR expected associated type, found associated function `Dr::Z` ::X::N; //~ ERROR no associated item named `N` found for type `u16` }