@@ -4,65 +4,86 @@ error[E0433]: failed to resolve: use of unresolved module or unlinked crate `a`
4
4
LL | #[::a]
5
5
| ^ use of unresolved module or unlinked crate `a`
6
6
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
9
9
|
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
+ | ^^^^^^^^^^^^^^^^^
15
18
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
17
38
--> $DIR/naked-invalid-attr.rs:13:1
18
39
|
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
+ | ^^^^^^^^^^^^^^^^
28
42
29
- error: attribute should be applied to a function definition
43
+ error: `#[naked]` attribute cannot be used on struct fields
30
44
--> $DIR/naked-invalid-attr.rs:16:5
31
45
|
32
46
LL | #[unsafe(naked)]
33
47
| ^^^^^^^^^^^^^^^^
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
39
51
|
40
52
LL | #[unsafe(naked)]
41
53
| ^^^^^^^^^^^^^^^^
42
- LL | || {};
43
- | ----- not a function definition
44
54
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
46
62
--> $DIR/naked-invalid-attr.rs:22:5
47
63
|
48
64
LL | #[unsafe(naked)]
49
65
| ^^^^^^^^^^^^^^^^
50
- LL | extern "C" fn invoke(&self);
51
- | ---------------------------- not a function definition
52
66
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
55
75
|
56
76
LL | #[unsafe(naked)]
57
77
| ^^^^^^^^^^^^^^^^
58
- LL | fn f();
59
- | ------- not a function definition
60
78
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
63
81
|
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
66
87
67
88
error: aborting due to 8 previous errors
68
89
0 commit comments