Skip to content

Commit 87b2796

Browse files
Add test for unnecessary unsafe on proc macro attr
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
1 parent c8618d2 commit 87b2796

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ proc-macro: external-macro-use.rs
2+
3+
extern crate external_macro_use;
4+
5+
#[unsafe(external_macro_use::a)]
6+
//~^ ERROR unnecessary `unsafe` on safe attribute
7+
fn f() {}
8+
9+
fn main() {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: unnecessary `unsafe` on safe attribute
2+
--> $DIR/proc-macro-unsafe.rs:5:3
3+
|
4+
LL | #[unsafe(external_macro_use::a)]
5+
| ^^^^^^
6+
7+
error: aborting due to 1 previous error
8+

0 commit comments

Comments
 (0)