]> git.proxmox.com Git - rustc.git/blame - src/test/ui/substs-ppaux.rs
New upstream version 1.57.0+dfsg1
[rustc.git] / src / test / ui / substs-ppaux.rs
CommitLineData
54a0048b
SL
1//
2// revisions: verbose normal
3//
4//[verbose] compile-flags: -Z verbose
5
6trait Foo<'b, 'c, S=u32> {
7 fn bar<'a, T>() where T: 'a {}
8 fn baz() {}
9}
10
11impl<'a,'b,T,S> Foo<'a, 'b, S> for T {}
12
13fn main() {}
14
15fn foo<'z>() where &'z (): Sized {
16 let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>;
17 //[verbose]~^ ERROR mismatched types
60c5eb7d
XL
18 //[verbose]~| expected unit type `()`
19 //[verbose]~| found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::bar::<ReStatic, char>}`
54a0048b 20 //[normal]~^^^^ ERROR mismatched types
60c5eb7d
XL
21 //[normal]~| expected unit type `()`
22 //[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}`
54a0048b
SL
23
24
25 let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>;
26 //[verbose]~^ ERROR mismatched types
60c5eb7d
XL
27 //[verbose]~| expected unit type `()`
28 //[verbose]~| found fn item `fn() {<i8 as Foo<ReStatic, ReStatic>>::bar::<ReStatic, char>}`
54a0048b 29 //[normal]~^^^^ ERROR mismatched types
60c5eb7d
XL
30 //[normal]~| expected unit type `()`
31 //[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}`
54a0048b
SL
32
33 let x: () = <i8 as Foo<'static, 'static, u8>>::baz;
34 //[verbose]~^ ERROR mismatched types
60c5eb7d
XL
35 //[verbose]~| expected unit type `()`
36 //[verbose]~| found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::baz}`
54a0048b 37 //[normal]~^^^^ ERROR mismatched types
60c5eb7d
XL
38 //[normal]~| expected unit type `()`
39 //[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}`
54a0048b
SL
40
41 let x: () = foo::<'static>;
42 //[verbose]~^ ERROR mismatched types
60c5eb7d
XL
43 //[verbose]~| expected unit type `()`
44 //[verbose]~| found fn item `fn() {foo::<ReStatic>}`
54a0048b 45 //[normal]~^^^^ ERROR mismatched types
60c5eb7d
XL
46 //[normal]~| expected unit type `()`
47 //[normal]~| found fn item `fn() {foo::<'static>}`
54a0048b
SL
48
49 <str as Foo<u8>>::bar;
8faf50e0
XL
50 //[verbose]~^ ERROR the size for values of type
51 //[normal]~^^ ERROR the size for values of type
54a0048b 52}