mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-03 05:27:36 +00:00
28 lines
743 B
Rust
28 lines
743 B
Rust
![]() |
#![feature(unsafe_attributes)]
|
||
|
|
||
|
#[unsafe(proc_macro)]
|
||
|
//~^ ERROR: is not an unsafe attribute
|
||
|
//~| ERROR attribute is only usable with crates of the `proc-macro` crate type
|
||
|
pub fn a() {}
|
||
|
|
||
|
|
||
|
#[unsafe(proc_macro_derive(Foo))]
|
||
|
//~^ ERROR: is not an unsafe attribute
|
||
|
//~| ERROR attribute is only usable with crates of the `proc-macro` crate type
|
||
|
pub fn b() {}
|
||
|
|
||
|
#[proc_macro_derive(unsafe(Foo))]
|
||
|
//~^ ERROR attribute is only usable with crates of the `proc-macro` crate type
|
||
|
pub fn c() {}
|
||
|
|
||
|
#[unsafe(proc_macro_attribute)]
|
||
|
//~^ ERROR: is not an unsafe attribute
|
||
|
//~| ERROR attribute is only usable with crates of the `proc-macro` crate type
|
||
|
pub fn d() {}
|
||
|
|
||
|
#[unsafe(allow(dead_code))]
|
||
|
//~^ ERROR: is not an unsafe attribute
|
||
|
pub fn e() {}
|
||
|
|
||
|
fn main() {}
|