]> git.lizzy.rs Git - rust.git/blob - tests/ui/proc-macro/ambiguous-builtin-attrs.rs
Rollup merge of #106788 - estebank:elaborate_pred_E0599, r=compiler-errors
[rust.git] / tests / ui / proc-macro / ambiguous-builtin-attrs.rs
1 // edition:2018
2 // aux-build:builtin-attrs.rs
3 #![feature(decl_macro)] //~ ERROR `feature` is ambiguous
4
5 extern crate builtin_attrs;
6 use builtin_attrs::*;
7 use builtin_attrs::{bench, test};
8
9 #[repr(C)] //~ ERROR `repr` is ambiguous
10 struct S;
11 #[cfg_attr(all(), repr(C))] //~ ERROR `repr` is ambiguous
12 struct SCond;
13
14 #[test] // OK, shadowed
15 fn test() {}
16
17 #[bench] // OK, shadowed
18 fn bench() {}
19
20 fn non_macro_expanded_location<#[repr(C)] T>() {
21     //~^ ERROR `repr` is ambiguous
22     //~| ERROR attribute should be applied to a struct, enum, or union
23     match 0u8 {
24         #[repr(C)]
25         //~^ ERROR `repr` is ambiguous
26         //~| ERROR attribute should be applied to a struct, enum, or union
27         _ => {}
28     }
29 }
30
31 fn main() {
32     Test;
33     Bench;
34     NonExistent; //~ ERROR cannot find value `NonExistent` in this scope
35 }
36
37 use deny as allow;
38 #[allow(unused)] //~ ERROR `allow` is ambiguous
39 fn builtin_renamed() {}