1 // Unit test for the "user substitutions" that are annotated on each
4 // compile-flags:-Zverbose
7 #![feature(rustc_attrs)]
9 // Note: we reference the names T and U in the comments below.
11 fn method<U>(&self, arg: T, arg2: U) { }
14 impl<T, U> Bazoom<U> for T {
17 fn foo<'a, T>(_: T) { }
19 #[rustc_dump_user_substs]
21 // Here: nothing is given, so we don't have any annotation.
25 // Here: `u32` is given.
26 let x = foo::<u32>; //~ ERROR [u32]
29 // Here: we only want the `T` to be given, the rest should be variables.
31 // (`T` refers to the declaration of `Bazoom`)
32 let x = <_ as Bazoom<u32>>::method::<_>; //~ ERROR [^0, u32, ^1]
35 // Here: all are given
36 let x = <u8 as Bazoom<u16>>::method::<u32>; //~ ERROR [u8, u16, u32]
39 // Here: we want in particular that *only* the method `U`
40 // annotation is given, the rest are variables.
42 // (`U` refers to the declaration of `Bazoom`)
44 y.method::<u32>(44, 66); //~ ERROR [^0, ^1, u32]
46 // Here: nothing is given, so we don't have any annotation.