1+ error[E0452]: malformed lint attribute input
2+ --> $DIR/proc-unsafe-attributes.rs:28:16
3+ |
4+ LL | #[unsafe(allow(unsafe(dead_code)))]
5+ | ^^^^^^^^^^^^^^^^^ bad attribute argument
6+
7+ error[E0452]: malformed lint attribute input
8+ --> $DIR/proc-unsafe-attributes.rs:28:16
9+ |
10+ LL | #[unsafe(allow(unsafe(dead_code)))]
11+ | ^^^^^^^^^^^^^^^^^ bad attribute argument
12+ |
13+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
14+
115error: `proc_macro` is not an unsafe attribute
216 --> $DIR/proc-unsafe-attributes.rs:3:3
317 |
@@ -14,22 +28,52 @@ LL | #[unsafe(proc_macro_derive(Foo))]
1428 |
1529 = note: extraneous unsafe is not allowed in attributes
1630
31+ error: expected identifier, found keyword `unsafe`
32+ --> $DIR/proc-unsafe-attributes.rs:14:21
33+ |
34+ LL | #[proc_macro_derive(unsafe(Foo))]
35+ | ^^^^^^ expected identifier, found keyword
36+ |
37+ help: escape `unsafe` to use it as an identifier
38+ |
39+ LL | #[proc_macro_derive(r#unsafe(Foo))]
40+ | ++
41+
1742error: `proc_macro_attribute` is not an unsafe attribute
18- --> $DIR/proc-unsafe-attributes.rs:18 :3
43+ --> $DIR/proc-unsafe-attributes.rs:19 :3
1944 |
2045LL | #[unsafe(proc_macro_attribute)]
2146 | ^^^^^^
2247 |
2348 = note: extraneous unsafe is not allowed in attributes
2449
2550error: `allow` is not an unsafe attribute
26- --> $DIR/proc-unsafe-attributes.rs:23 :3
51+ --> $DIR/proc-unsafe-attributes.rs:24 :3
2752 |
2853LL | #[unsafe(allow(dead_code))]
2954 | ^^^^^^
3055 |
3156 = note: extraneous unsafe is not allowed in attributes
3257
58+ error: `allow` is not an unsafe attribute
59+ --> $DIR/proc-unsafe-attributes.rs:28:3
60+ |
61+ LL | #[unsafe(allow(unsafe(dead_code)))]
62+ | ^^^^^^
63+ |
64+ = note: extraneous unsafe is not allowed in attributes
65+
66+ error: expected identifier, found keyword `unsafe`
67+ --> $DIR/proc-unsafe-attributes.rs:28:16
68+ |
69+ LL | #[unsafe(allow(unsafe(dead_code)))]
70+ | ^^^^^^ expected identifier, found keyword
71+ |
72+ help: escape `unsafe` to use it as an identifier
73+ |
74+ LL | #[unsafe(allow(r#unsafe(dead_code)))]
75+ | ++
76+
3377error: the `#[proc_macro]` attribute is only usable with crates of the `proc-macro` crate type
3478 --> $DIR/proc-unsafe-attributes.rs:3:1
3579 |
@@ -49,10 +93,27 @@ LL | #[proc_macro_derive(unsafe(Foo))]
4993 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5094
5195error: the `#[proc_macro_attribute]` attribute is only usable with crates of the `proc-macro` crate type
52- --> $DIR/proc-unsafe-attributes.rs:18 :1
96+ --> $DIR/proc-unsafe-attributes.rs:19 :1
5397 |
5498LL | #[unsafe(proc_macro_attribute)]
5599 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56100
57- error: aborting due to 8 previous errors
101+ error[E0452]: malformed lint attribute input
102+ --> $DIR/proc-unsafe-attributes.rs:28:16
103+ |
104+ LL | #[unsafe(allow(unsafe(dead_code)))]
105+ | ^^^^^^^^^^^^^^^^^ bad attribute argument
106+ |
107+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
108+
109+ error[E0452]: malformed lint attribute input
110+ --> $DIR/proc-unsafe-attributes.rs:28:16
111+ |
112+ LL | #[unsafe(allow(unsafe(dead_code)))]
113+ | ^^^^^^^^^^^^^^^^^ bad attribute argument
114+ |
115+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
116+
117+ error: aborting due to 15 previous errors
58118
119+ For more information about this error, try `rustc --explain E0452`.
0 commit comments