]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/self_type_keyword.rs
Update ui tests
[rust.git] / src / test / ui / self / self_type_keyword.rs
1 mod foo {
2   struct Self;
3   //~^ ERROR expected identifier, found keyword `Self`
4 }
5
6 struct Bar<'Self>;
7 //~^ ERROR lifetimes cannot use keyword names
8 //~| ERROR parameter `'Self` is never used
9
10 struct Foo;
11
12 pub fn main() {
13     match 15 {
14         ref Self => (),
15         //~^ ERROR expected identifier, found keyword `Self`
16         mut Self => (),
17         //~^ ERROR `mut` must be followed by a named binding
18         //~| ERROR cannot find unit struct/variant or constant `Self`
19         ref mut Self => (),
20         //~^ ERROR expected identifier, found keyword `Self`
21         Self!() => (),
22         //~^ ERROR cannot find macro `Self` in this scope
23         Foo { Self } => (),
24         //~^ ERROR expected identifier, found keyword `Self`
25     }
26 }
27
28 mod m1 {
29     extern crate core as Self;
30     //~^ ERROR expected identifier, found keyword `Self`
31 }
32
33 mod m2 {
34     use std::option::Option as Self;
35     //~^ ERROR expected identifier, found keyword `Self`
36 }
37
38 mod m3 {
39     trait Self {}
40     //~^ ERROR expected identifier, found keyword `Self`
41 }