]> git.lizzy.rs Git - rust.git/blob - src/test/ui/feature-gates/feature-gate-rustc-attrs.rs
Rollup merge of #94263 - anko:patch-1, r=GuillaumeGomez
[rust.git] / src / test / ui / feature-gates / feature-gate-rustc-attrs.rs
1 // Test that `#[rustc_*]` attributes are gated by `rustc_attrs` feature gate.
2
3 #![feature(decl_macro)]
4
5 mod rustc { pub macro unknown() {} }
6 mod unknown { pub macro rustc() {} }
7
8 #[rustc::unknown]
9 //~^ ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler
10 //~| ERROR expected attribute, found macro `rustc::unknown`
11 fn f() {}
12
13 #[unknown::rustc]
14 //~^ ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler
15 //~| ERROR expected attribute, found macro `unknown::rustc`
16 fn g() {}
17
18 #[rustc_dummy]
19 //~^ ERROR the `#[rustc_dummy]` attribute is just used for rustc unit tests
20 #[rustc_unknown]
21 //~^ ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler
22 //~| ERROR cannot find attribute `rustc_unknown` in this scope
23 fn main() {}