1
+ error: expected unsuffixed literal, found `-`
2
+ --> $DIR/malformed-fn-align.rs:24:9
3
+ |
4
+ LL | #[align(-1)]
5
+ | ^
6
+
7
+ error: suffixed literals are not allowed in attributes
8
+ --> $DIR/malformed-fn-align.rs:30:9
9
+ |
10
+ LL | #[align(4usize)]
11
+ | ^^^^^^
12
+ |
13
+ = help: instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.)
14
+
1
15
error[E0539]: malformed `align` attribute input
2
16
--> $DIR/malformed-fn-align.rs:5:5
3
17
|
@@ -37,6 +51,24 @@ error[E0589]: invalid alignment value: not a power of two
37
51
LL | #[align(0)]
38
52
| ^
39
53
54
+ error[E0589]: invalid alignment value: not a power of two
55
+ --> $DIR/malformed-fn-align.rs:27:9
56
+ |
57
+ LL | #[align(3)]
58
+ | ^
59
+
60
+ error[E0589]: invalid alignment value: not an unsuffixed integer
61
+ --> $DIR/malformed-fn-align.rs:30:9
62
+ |
63
+ LL | #[align(4usize)]
64
+ | ^^^^^^
65
+
66
+ error[E0589]: invalid alignment value: not a power of two
67
+ --> $DIR/malformed-fn-align.rs:35:9
68
+ |
69
+ LL | #[align(3)]
70
+ | ^
71
+
40
72
error: `#[repr(align(...))]` is not supported on function items
41
73
--> $DIR/malformed-fn-align.rs:21:8
42
74
|
@@ -50,7 +82,7 @@ LL | #[repr(align(16))]
50
82
| ^^^^^^^^^
51
83
52
84
error: `#[align(...)]` is not supported on struct items
53
- --> $DIR/malformed-fn-align.rs:24 :1
85
+ --> $DIR/malformed-fn-align.rs:39 :1
54
86
|
55
87
LL | #[align(16)]
56
88
| ^^^^^^^^^^^^
@@ -61,7 +93,31 @@ LL - #[align(16)]
61
93
LL + #[repr(align(16))]
62
94
|
63
95
64
- error: aborting due to 7 previous errors
96
+ error: `#[align(...)]` should be applied to a function item
97
+ --> $DIR/malformed-fn-align.rs:42:1
98
+ |
99
+ LL | #[align(32)]
100
+ | ^^^^^^^^^^^^
101
+ LL | const FOO: i32 = 42;
102
+ | -------------------- not a function item
103
+
104
+ error: `#[align(...)]` should be applied to a function item
105
+ --> $DIR/malformed-fn-align.rs:45:1
106
+ |
107
+ LL | #[align(32)]
108
+ | ^^^^^^^^^^^^
109
+ LL | mod test {}
110
+ | ----------- not a function item
111
+
112
+ error: `#[align(...)]` should be applied to a function item
113
+ --> $DIR/malformed-fn-align.rs:48:1
114
+ |
115
+ LL | #[align(32)]
116
+ | ^^^^^^^^^^^^
117
+ LL | use ::std::iter;
118
+ | ---------------- not a function item
119
+
120
+ error: aborting due to 15 previous errors
65
121
66
122
Some errors have detailed explanations: E0539, E0589, E0805.
67
123
For more information about an error, try `rustc --explain E0539`.
0 commit comments