]> git.proxmox.com Git - rustc.git/blame - src/test/ui/proc-macro/ambiguous-builtin-attrs.rs
New upstream version 1.50.0+dfsg1
[rustc.git] / src / test / ui / proc-macro / ambiguous-builtin-attrs.rs
CommitLineData
b7449926
XL
1// aux-build:builtin-attrs.rs
2
3#![feature(decl_macro)] //~ ERROR `feature` is ambiguous
4
5extern crate builtin_attrs;
6use builtin_attrs::{test, bench};
7use builtin_attrs::*;
8
9#[repr(C)] //~ ERROR `repr` is ambiguous
10struct S;
11#[cfg_attr(all(), repr(C))] //~ ERROR `repr` is ambiguous
12struct SCond;
13
14#[test] // OK, shadowed
15fn test() {}
16
17#[bench] // OK, shadowed
18fn bench() {}
19
fc512014
XL
20fn non_macro_expanded_location<#[repr(C)] T>() {
21 //~^ ERROR `repr` is ambiguous
22 //~| ERROR attribute should be applied to a struct, enum, or union
b7449926
XL
23 match 0u8 {
24 #[repr(C)] //~ ERROR `repr` is ambiguous
25 _ => {}
26 }
27}
28
29fn main() {
30 Test;
31 Bench;
32 NonExistent; //~ ERROR cannot find value `NonExistent` in this scope
33}