2020-12-13 16:34:04 +00:00
|
|
|
//@ edition:2018
|
2018-09-02 21:04:54 +00:00
|
|
|
//@ aux-build:builtin-attrs.rs
|
|
|
|
#![feature(decl_macro)] //~ ERROR `feature` is ambiguous
|
|
|
|
|
|
|
|
extern crate builtin_attrs;
|
|
|
|
use builtin_attrs::*;
|
2021-01-08 09:00:39 +00:00
|
|
|
use builtin_attrs::{bench, test};
|
2018-09-02 21:04:54 +00:00
|
|
|
|
|
|
|
#[repr(C)] //~ ERROR `repr` is ambiguous
|
|
|
|
struct S;
|
|
|
|
#[cfg_attr(all(), repr(C))] //~ ERROR `repr` is ambiguous
|
|
|
|
struct SCond;
|
|
|
|
|
|
|
|
#[test] // OK, shadowed
|
|
|
|
fn test() {}
|
|
|
|
|
|
|
|
#[bench] // OK, shadowed
|
|
|
|
fn bench() {}
|
|
|
|
|
2020-11-15 13:03:30 +00:00
|
|
|
fn non_macro_expanded_location<#[repr(C)] T>() {
|
|
|
|
//~^ ERROR `repr` is ambiguous
|
|
|
|
//~| ERROR attribute should be applied to a struct, enum, or union
|
2018-09-02 21:04:54 +00:00
|
|
|
match 0u8 {
|
2021-02-01 14:35:53 +00:00
|
|
|
#[repr(C)]
|
|
|
|
//~^ ERROR `repr` is ambiguous
|
|
|
|
//~| ERROR attribute should be applied to a struct, enum, or union
|
2018-09-02 21:04:54 +00:00
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
Test;
|
|
|
|
Bench;
|
|
|
|
NonExistent; //~ ERROR cannot find value `NonExistent` in this scope
|
|
|
|
}
|
2020-12-13 16:34:04 +00:00
|
|
|
|
|
|
|
use deny as allow;
|
2021-10-20 13:56:10 +00:00
|
|
|
#[allow(unused)] //~ ERROR `allow` is ambiguous
|
2020-12-13 16:34:04 +00:00
|
|
|
fn builtin_renamed() {}
|