]> git.lizzy.rs Git - rust.git/blob - src/test/ui/substs-ppaux.rs
Rollup merge of #53317 - estebank:abolish-ice, r=oli-obk
[rust.git] / src / test / ui / substs-ppaux.rs
1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10 //
11 // revisions: verbose normal
12 //
13 //[verbose] compile-flags: -Z verbose
14
15 trait Foo<'b, 'c, S=u32> {
16     fn bar<'a, T>() where T: 'a {}
17     fn baz() {}
18 }
19
20 impl<'a,'b,T,S> Foo<'a, 'b, S> for T {}
21
22 fn main() {}
23
24 fn foo<'z>() where &'z (): Sized {
25     let x: () = <i8 as Foo<'static, 'static,  u8>>::bar::<'static, char>;
26     //[verbose]~^ ERROR mismatched types
27     //[verbose]~| expected type `()`
28     //[verbose]~| found type `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::bar::<ReStatic, char>}`
29     //[normal]~^^^^ ERROR mismatched types
30     //[normal]~| expected type `()`
31     //[normal]~| found type `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}`
32
33
34     let x: () = <i8 as Foo<'static, 'static,  u32>>::bar::<'static, char>;
35     //[verbose]~^ ERROR mismatched types
36     //[verbose]~| expected type `()`
37     //[verbose]~| found type `fn() {<i8 as Foo<ReStatic, ReStatic, u32>>::bar::<ReStatic, char>}`
38     //[normal]~^^^^ ERROR mismatched types
39     //[normal]~| expected type `()`
40     //[normal]~| found type `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}`
41
42     let x: () = <i8 as Foo<'static, 'static,  u8>>::baz;
43     //[verbose]~^ ERROR mismatched types
44     //[verbose]~| expected type `()`
45     //[verbose]~| found type `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::baz}`
46     //[normal]~^^^^ ERROR mismatched types
47     //[normal]~| expected type `()`
48     //[normal]~| found type `fn() {<i8 as Foo<'static, 'static, u8>>::baz}`
49
50     let x: () = foo::<'static>;
51     //[verbose]~^ ERROR mismatched types
52     //[verbose]~| expected type `()`
53     //[verbose]~| found type `fn() {foo::<ReStatic>}`
54     //[normal]~^^^^ ERROR mismatched types
55     //[normal]~| expected type `()`
56     //[normal]~| found type `fn() {foo::<'static>}`
57
58     <str as Foo<u8>>::bar;
59     //[verbose]~^ ERROR the size for values of type
60     //[normal]~^^ ERROR the size for values of type
61 }