]> git.lizzy.rs Git - rust.git/blob - tests/ui/proc-macro/generate-mod.rs
Rollup merge of #107189 - cjgillot:meta-adt, r=compiler-errors
[rust.git] / tests / ui / proc-macro / generate-mod.rs
1 // Modules generated by transparent proc macros still acts as barriers for names (issue #50504).
2
3 // aux-build:generate-mod.rs
4
5 extern crate generate_mod;
6
7 struct FromOutside;
8
9 generate_mod::check!(); //~ ERROR cannot find type `FromOutside` in this scope
10                         //~| ERROR cannot find type `Outer` in this scope
11
12 #[generate_mod::check_attr] //~ ERROR cannot find type `FromOutside` in this scope
13                             //~| ERROR cannot find type `OuterAttr` in this scope
14 struct S;
15
16 #[derive(generate_mod::CheckDerive)] //~ ERROR cannot find type `FromOutside` in this scope
17                                      //~| ERROR cannot find type `OuterDerive` in this scope
18                                      //~| WARN this was previously accepted
19                                      //~| WARN this was previously accepted
20 struct Z;
21
22 fn inner_block() {
23     #[derive(generate_mod::CheckDerive)] //~ ERROR cannot find type `FromOutside` in this scope
24                                         //~| ERROR cannot find type `OuterDerive` in this scope
25                                         //~| WARN this was previously accepted
26                                         //~| WARN this was previously accepted
27     struct InnerZ;
28 }
29
30 #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
31 struct W;
32
33 fn main() {}