You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mir_transform_unaligned_packed_ref = reference to packed field is unaligned
73
-
.note = this field is only {$actual}-byte aligned, but its type requires {$expected->
74
-
[0] more
75
-
*[other] {$expected}-byte
76
-
} alignment
73
+
.note = this field is only {$actual}-byte aligned, but its type requires more alignment
77
74
.note_ub = creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
78
75
.help = copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
Copy file name to clipboardExpand all lines: tests/ui/binding/issue-53114-safety-checks.stderr
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ error[E0793]: reference to packed field is unaligned
4
4
LL | let _ = &p.b;
5
5
| ^^^^
6
6
|
7
-
= note: this field is only 1-byte aligned, but its type requires 8-byte alignment
7
+
= note: this field is only 1-byte aligned, but its type requires more alignment
8
8
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
9
9
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
10
10
@@ -14,7 +14,7 @@ error[E0793]: reference to packed field is unaligned
14
14
LL | let (_,) = (&p.b,);
15
15
| ^^^^
16
16
|
17
-
= note: this field is only 1-byte aligned, but its type requires 8-byte alignment
17
+
= note: this field is only 1-byte aligned, but its type requires more alignment
18
18
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
19
19
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
20
20
@@ -56,7 +56,7 @@ error[E0793]: reference to packed field is unaligned
56
56
LL | let _: _ = &p.b;
57
57
| ^^^^
58
58
|
59
-
= note: this field is only 1-byte aligned, but its type requires 8-byte alignment
59
+
= note: this field is only 1-byte aligned, but its type requires more alignment
60
60
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
61
61
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
62
62
@@ -66,7 +66,7 @@ error[E0793]: reference to packed field is unaligned
66
66
LL | let (_,): _ = (&p.b,);
67
67
| ^^^^
68
68
|
69
-
= note: this field is only 1-byte aligned, but its type requires 8-byte alignment
69
+
= note: this field is only 1-byte aligned, but its type requires more alignment
70
70
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
71
71
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
72
72
@@ -108,7 +108,7 @@ error[E0793]: reference to packed field is unaligned
108
108
LL | match &p.b { _ => { } }
109
109
| ^^^^
110
110
|
111
-
= note: this field is only 1-byte aligned, but its type requires 8-byte alignment
111
+
= note: this field is only 1-byte aligned, but its type requires more alignment
112
112
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
113
113
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
114
114
@@ -118,7 +118,7 @@ error[E0793]: reference to packed field is unaligned
118
118
LL | match (&p.b,) { (_,) => { } }
119
119
| ^^^^
120
120
|
121
-
= note: this field is only 1-byte aligned, but its type requires 8-byte alignment
121
+
= note: this field is only 1-byte aligned, but its type requires more alignment
122
122
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
123
123
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
Copy file name to clipboardExpand all lines: tests/ui/closures/2229_closure_analysis/diagnostics/repr_packed.stderr
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ error[E0793]: reference to packed field is unaligned
4
4
LL | println!("{}", foo.x);
5
5
| ^^^^^
6
6
|
7
-
= note: this field is only 1-byte aligned, but its type requires 8-byte alignment
7
+
= note: this field is only 1-byte aligned, but its type requires more alignment
8
8
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
9
9
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
10
10
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
Copy file name to clipboardExpand all lines: tests/ui/lint/unaligned_references.current.stderr
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ error[E0793]: reference to packed field is unaligned
4
4
LL | &self.x;
5
5
| ^^^^^^^
6
6
|
7
-
= note: this field is only 2-byte aligned, but its type requires 4-byte alignment
7
+
= note: this field is only 2-byte aligned, but its type requires more alignment
8
8
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
9
9
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
10
10
@@ -24,7 +24,7 @@ error[E0793]: reference to packed field is unaligned
24
24
LL | println!("{:?}", &*foo.0);
25
25
| ^^^^^
26
26
|
27
-
= note: this field is only 1-byte aligned, but its type requires 8-byte alignment
27
+
= note: this field is only 1-byte aligned, but its type requires more alignment
28
28
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
29
29
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
30
30
@@ -44,7 +44,7 @@ error[E0793]: reference to packed field is unaligned
44
44
LL | let _ = &good.ptr;
45
45
| ^^^^^^^^^
46
46
|
47
-
= note: this field is only 1-byte aligned, but its type requires 8-byte alignment
47
+
= note: this field is only 1-byte aligned, but its type requires more alignment
48
48
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
49
49
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
50
50
@@ -54,7 +54,7 @@ error[E0793]: reference to packed field is unaligned
54
54
LL | let _ = &good.data;
55
55
| ^^^^^^^^^^
56
56
|
57
-
= note: this field is only 1-byte aligned, but its type requires 8-byte alignment
57
+
= note: this field is only 1-byte aligned, but its type requires more alignment
58
58
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
59
59
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
60
60
@@ -64,7 +64,7 @@ error[E0793]: reference to packed field is unaligned
64
64
LL | let _ = &good.data as *const _;
65
65
| ^^^^^^^^^^
66
66
|
67
-
= note: this field is only 1-byte aligned, but its type requires 8-byte alignment
67
+
= note: this field is only 1-byte aligned, but its type requires more alignment
68
68
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
69
69
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
70
70
@@ -74,7 +74,7 @@ error[E0793]: reference to packed field is unaligned
74
74
LL | let _: *const _ = &good.data;
75
75
| ^^^^^^^^^^
76
76
|
77
-
= note: this field is only 1-byte aligned, but its type requires 8-byte alignment
77
+
= note: this field is only 1-byte aligned, but its type requires more alignment
78
78
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
79
79
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
80
80
@@ -84,7 +84,7 @@ error[E0793]: reference to packed field is unaligned
84
84
LL | let _ = good.data.clone();
85
85
| ^^^^^^^^^
86
86
|
87
-
= note: this field is only 1-byte aligned, but its type requires 8-byte alignment
87
+
= note: this field is only 1-byte aligned, but its type requires more alignment
88
88
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
89
89
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
90
90
@@ -94,7 +94,7 @@ error[E0793]: reference to packed field is unaligned
94
94
LL | let _ = &good.data2[0];
95
95
| ^^^^^^^^^^^^^^
96
96
|
97
-
= note: this field is only 1-byte aligned, but its type requires 8-byte alignment
97
+
= note: this field is only 1-byte aligned, but its type requires more alignment
98
98
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
99
99
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
100
100
@@ -104,7 +104,7 @@ error[E0793]: reference to packed field is unaligned
104
104
LL | let _ = &packed2.x;
105
105
| ^^^^^^^^^^
106
106
|
107
-
= note: this field is only 2-byte aligned, but its type requires 4-byte alignment
107
+
= note: this field is only 2-byte aligned, but its type requires more alignment
108
108
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
109
109
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
110
110
@@ -114,7 +114,7 @@ error[E0793]: reference to packed field is unaligned
114
114
LL | let _ref = &m1.1.a;
115
115
| ^^^^^^^
116
116
|
117
-
= note: this field is only 1-byte aligned, but its type requires 2-byte alignment
117
+
= note: this field is only 1-byte aligned, but its type requires more alignment
118
118
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
119
119
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
120
120
@@ -124,7 +124,7 @@ error[E0793]: reference to packed field is unaligned
124
124
LL | let _ref = &m2.1.a;
125
125
| ^^^^^^^
126
126
|
127
-
= note: this field is only 1-byte aligned, but its type requires 2-byte alignment
127
+
= note: this field is only 1-byte aligned, but its type requires more alignment
128
128
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
129
129
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
0 commit comments