@@ -4,65 +4,86 @@ error[E0433]: failed to resolve: use of unresolved module or unlinked crate `a`
44LL | #[::a]
55 | ^ use of unresolved module or unlinked crate `a`
66
7- error[E0736]: attribute incompatible with `#[unsafe( naked)]`
8- --> $DIR/naked-invalid-attr.rs:56:3
7+ error: `#[naked]` attribute cannot be used on crates
8+ --> $DIR/naked-invalid-attr.rs:4:1
99 |
10- LL | #[::a]
11- | ^^^ the `::a` attribute is incompatible with `#[unsafe(naked)]`
12- ...
13- LL | #[unsafe(naked)]
14- | ---------------- function marked with `#[unsafe(naked)]` here
10+ LL | #![unsafe(naked)]
11+ | ^^^^^^^^^^^^^^^^^
12+ |
13+ help: `#[naked]` can be applied to functions
14+ --> $DIR/naked-invalid-attr.rs:4:1
15+ |
16+ LL | #![unsafe(naked)]
17+ | ^^^^^^^^^^^^^^^^^
1518
16- error: attribute should be applied to a function definition
19+ error: `#[naked]` attribute cannot be used on foreign functions
20+ --> $DIR/naked-invalid-attr.rs:9:5
21+ |
22+ LL | #[unsafe(naked)]
23+ | ^^^^^^^^^^^^^^^^
24+ |
25+ help: `#[naked]` can be applied to methods, functions
26+ --> $DIR/naked-invalid-attr.rs:9:5
27+ |
28+ LL | #[unsafe(naked)]
29+ | ^^^^^^^^^^^^^^^^
30+
31+ error: `#[naked]` attribute cannot be used on structs
32+ --> $DIR/naked-invalid-attr.rs:13:1
33+ |
34+ LL | #[unsafe(naked)]
35+ | ^^^^^^^^^^^^^^^^
36+ |
37+ help: `#[naked]` can be applied to functions
1738 --> $DIR/naked-invalid-attr.rs:13:1
1839 |
19- LL | #[unsafe(naked)]
20- | ^^^^^^^^^^^^^^^^
21- LL | #[repr(C)]
22- LL | / struct S {
23- LL | | #[unsafe(naked)]
24- LL | | a: u32,
25- LL | | b: u32,
26- LL | | }
27- | |_- not a function definition
40+ LL | #[unsafe(naked)]
41+ | ^^^^^^^^^^^^^^^^
2842
29- error: attribute should be applied to a function definition
43+ error: `#[naked]` attribute cannot be used on struct fields
3044 --> $DIR/naked-invalid-attr.rs:16:5
3145 |
3246LL | #[unsafe(naked)]
3347 | ^^^^^^^^^^^^^^^^
34- LL | a: u32,
35- | ------ not a function definition
36-
37- error: attribute should be applied to a function definition
38- --> $DIR/naked-invalid-attr.rs:51:5
48+ |
49+ help: `#[naked]` can be applied to functions
50+ --> $DIR/naked-invalid-attr.rs:16:5
3951 |
4052LL | #[unsafe(naked)]
4153 | ^^^^^^^^^^^^^^^^
42- LL | || {};
43- | ----- not a function definition
4454
45- error: attribute should be applied to a function definition
55+ error: `#[naked]` attribute cannot be used on required trait methods
56+ --> $DIR/naked-invalid-attr.rs:22:5
57+ |
58+ LL | #[unsafe(naked)]
59+ | ^^^^^^^^^^^^^^^^
60+ |
61+ help: `#[naked]` can be applied to functions, inherent methods, provided trait methods, trait methods in impl blocks
4662 --> $DIR/naked-invalid-attr.rs:22:5
4763 |
4864LL | #[unsafe(naked)]
4965 | ^^^^^^^^^^^^^^^^
50- LL | extern "C" fn invoke(&self);
51- | ---------------------------- not a function definition
5266
53- error: attribute should be applied to a function definition
54- --> $DIR/naked-invalid-attr.rs:9:5
67+ error: `#[naked]` attribute cannot be used on closures
68+ --> $DIR/naked-invalid-attr.rs:51:5
69+ |
70+ LL | #[unsafe(naked)]
71+ | ^^^^^^^^^^^^^^^^
72+ |
73+ help: `#[naked]` can be applied to methods, functions
74+ --> $DIR/naked-invalid-attr.rs:51:5
5575 |
5676LL | #[unsafe(naked)]
5777 | ^^^^^^^^^^^^^^^^
58- LL | fn f();
59- | ------- not a function definition
6078
61- error: attribute should be applied to a function definition
62- --> $DIR/naked-invalid-attr.rs:4:1
79+ error[E0736] : attribute incompatible with `#[unsafe(naked)]`
80+ --> $DIR/naked-invalid-attr.rs:56:3
6381 |
64- LL | #![unsafe(naked)]
65- | ^^^^^^^^^^^^^^^^^ cannot be applied to crates
82+ LL | #[::a]
83+ | ^^^ the `::a` attribute is incompatible with `#[unsafe(naked)]`
84+ ...
85+ LL | #[unsafe(naked)]
86+ | ---------------- function marked with `#[unsafe(naked)]` here
6687
6788error: aborting due to 8 previous errors
6889
0 commit comments