File tree 2 files changed +36
-0
lines changed
tests/ui/attributes/unsafe
2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ #![ feature( unsafe_attributes) ]
2
+
3
+ #[ unsafe( unsafe ( no_mangle) ) ]
4
+ //~^ ERROR expected identifier, found keyword `unsafe`
5
+ //~| ERROR cannot find attribute `r#unsafe` in this scope
6
+ //~| ERROR `r#unsafe` is not an unsafe attribute
7
+ fn a ( ) { }
8
+
9
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error: expected identifier, found keyword `unsafe`
2
+ --> $DIR/double-unsafe-attributes.rs:3:10
3
+ |
4
+ LL | #[unsafe(unsafe(no_mangle))]
5
+ | ^^^^^^ expected identifier, found keyword
6
+ |
7
+ help: escape `unsafe` to use it as an identifier
8
+ |
9
+ LL | #[unsafe(r#unsafe(no_mangle))]
10
+ | ++
11
+
12
+ error: cannot find attribute `r#unsafe` in this scope
13
+ --> $DIR/double-unsafe-attributes.rs:3:10
14
+ |
15
+ LL | #[unsafe(unsafe(no_mangle))]
16
+ | ^^^^^^
17
+
18
+ error: `r#unsafe` is not an unsafe attribute
19
+ --> $DIR/double-unsafe-attributes.rs:3:3
20
+ |
21
+ LL | #[unsafe(unsafe(no_mangle))]
22
+ | ^^^^^^
23
+ |
24
+ = note: extraneous unsafe is not allowed in attributes
25
+
26
+ error: aborting due to 3 previous errors
27
+
You can’t perform that action at this time.
0 commit comments