1 #![feature(associated_type_defaults)]
19 let _: <u8 as Tr>::N; //~ ERROR cannot find associated type `N` in trait `Tr`
20 let _: <u8 as E>::N; //~ ERROR cannot find associated type `N` in enum `E`
21 let _: <u8 as A>::N; //~ ERROR cannot find associated type `N` in `A`
22 <u8 as Tr>::N; //~ ERROR cannot find method or associated constant `N` in trait `Tr`
23 <u8 as E>::N; //~ ERROR cannot find method or associated constant `N` in enum `E`
24 <u8 as A>::N; //~ ERROR cannot find method or associated constant `N` in `A`
25 let _: <u8 as Tr>::Y; // OK
26 let _: <u8 as E>::Y; //~ ERROR expected associated type, found variant `E::Y`
28 <u8 as E>::Y; //~ ERROR expected method or associated constant, found unit variant `E::Y`
30 let _: <u8 as Tr>::N::NN; //~ ERROR cannot find associated type `N` in trait `Tr`
31 let _: <u8 as E>::N::NN; //~ ERROR cannot find associated type `N` in enum `E`
32 let _: <u8 as A>::N::NN; //~ ERROR cannot find associated type `N` in `A`
33 <u8 as Tr>::N::NN; //~ ERROR cannot find associated type `N` in trait `Tr`
34 <u8 as E>::N::NN; //~ ERROR cannot find associated type `N` in enum `E`
35 <u8 as A>::N::NN; //~ ERROR cannot find associated type `N` in `A`
36 let _: <u8 as Tr>::Y::NN; //~ ERROR ambiguous associated type
37 let _: <u8 as E>::Y::NN; //~ ERROR expected associated type, found variant `E::Y`
38 <u8 as Tr>::Y::NN; //~ ERROR no associated item named `NN` found for type `u16`
39 <u8 as E>::Y::NN; //~ ERROR expected associated type, found variant `E::Y`
41 let _: <u8 as Tr::N>::NN; //~ ERROR cannot find associated type `NN` in `Tr::N`
42 let _: <u8 as E::N>::NN; //~ ERROR cannot find associated type `NN` in `E::N`
43 let _: <u8 as A::N>::NN; //~ ERROR cannot find associated type `NN` in `A::N`
44 <u8 as Tr::N>::NN; //~ ERROR cannot find method or associated constant `NN` in `Tr::N`
45 <u8 as E::N>::NN; //~ ERROR cannot find method or associated constant `NN` in `E::N`
46 <u8 as A::N>::NN; //~ ERROR cannot find method or associated constant `NN` in `A::N`
47 let _: <u8 as Tr::Y>::NN; //~ ERROR cannot find associated type `NN` in `Tr::Y`
48 let _: <u8 as E::Y>::NN; //~ ERROR failed to resolve: `Y` is a variant, not a module
49 <u8 as Tr::Y>::NN; //~ ERROR cannot find method or associated constant `NN` in `Tr::Y`
50 <u8 as E::Y>::NN; //~ ERROR failed to resolve: `Y` is a variant, not a module
52 let _: <u8 as Dr>::Z; //~ ERROR expected associated type, found associated function `Dr::Z`
53 <u8 as Dr>::X; //~ ERROR expected method or associated constant, found associated type `Dr::X`
54 let _: <u8 as Dr>::Z::N; //~ ERROR expected associated type, found associated function `Dr::Z`
55 <u8 as Dr>::X::N; //~ ERROR no associated item named `N` found for type `u16`