]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/self_type_keyword.rs
Rollup merge of #61423 - davidtwco:correct-symbol-mangling, r=eddyb
[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 expected identifier, found keyword `Self`
18         ref mut Self => (),
19         //~^ ERROR expected identifier, found keyword `Self`
20         Self!() => (),
21         //~^ ERROR cannot find macro `Self!` in this scope
22         Foo { Self } => (),
23         //~^ ERROR expected identifier, found keyword `Self`
24     }
25 }
26
27 mod m1 {
28     extern crate core as Self;
29     //~^ ERROR expected identifier, found keyword `Self`
30 }
31
32 mod m2 {
33     use std::option::Option as Self;
34     //~^ ERROR expected identifier, found keyword `Self`
35 }
36
37 mod m3 {
38     trait Self {}
39     //~^ ERROR expected identifier, found keyword `Self`
40 }