]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/substs-ppaux.rs
Auto merge of #103600 - compiler-errors:early-binder-nits, r=spastorino
[rust.git] / src / test / ui / associated-types / substs-ppaux.rs
1 //
2 // revisions: verbose normal
3 //
4 //[verbose] compile-flags: -Z verbose
5
6 trait Foo<'b, 'c, S=u32> {
7     fn bar<'a, T>() where T: 'a {}
8     fn baz() {}
9 }
10
11 impl<'a,'b,T,S> Foo<'a, 'b, S> for T {}
12
13 fn main() {}
14
15 fn foo<'z>() where &'z (): Sized {
16     let x: () = <i8 as Foo<'static, 'static,  u8>>::bar::<'static, char>;
17     //[verbose]~^ ERROR mismatched types
18     //[verbose]~| expected unit type `()`
19     //[verbose]~| found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::bar::<ReStatic, char>}`
20     //[normal]~^^^^ ERROR mismatched types
21     //[normal]~| expected unit type `()`
22     //[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}`
23
24
25     let x: () = <i8 as Foo<'static, 'static,  u32>>::bar::<'static, char>;
26     //[verbose]~^ ERROR mismatched types
27     //[verbose]~| expected unit type `()`
28     //[verbose]~| found fn item `fn() {<i8 as Foo<ReStatic, ReStatic>>::bar::<ReStatic, char>}`
29     //[normal]~^^^^ ERROR mismatched types
30     //[normal]~| expected unit type `()`
31     //[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}`
32
33     let x: () = <i8 as Foo<'static, 'static,  u8>>::baz;
34     //[verbose]~^ ERROR mismatched types
35     //[verbose]~| expected unit type `()`
36     //[verbose]~| found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::baz}`
37     //[normal]~^^^^ ERROR mismatched types
38     //[normal]~| expected unit type `()`
39     //[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}`
40
41     let x: () = foo::<'static>;
42     //[verbose]~^ ERROR mismatched types
43     //[verbose]~| expected unit type `()`
44     //[verbose]~| found fn item `fn() {foo::<ReStatic>}`
45     //[normal]~^^^^ ERROR mismatched types
46     //[normal]~| expected unit type `()`
47     //[normal]~| found fn item `fn() {foo::<'static>}`
48
49     <str as Foo<u8>>::bar;
50     //[verbose]~^ ERROR the size for values of type
51     //[normal]~^^ ERROR the size for values of type
52 }