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
Copy file name to clipboardExpand all lines: tests/ui/binding/issue-53114-safety-checks.stderr
+12-6
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,8 @@ error[E0793]: reference to packed field is unaligned
4
4
LL | let _ = &p.b;
5
5
| ^^^^
6
6
|
7
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
7
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
8
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
8
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)
9
10
10
11
error[E0793]: reference to packed field is unaligned
@@ -13,7 +14,8 @@ error[E0793]: reference to packed field is unaligned
13
14
LL | let (_,) = (&p.b,);
14
15
| ^^^^
15
16
|
16
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
17
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
18
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
17
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)
18
20
19
21
error[E0793]: reference to packed field is unaligned
@@ -22,7 +24,8 @@ error[E0793]: reference to packed field is unaligned
22
24
LL | let _: _ = &p.b;
23
25
| ^^^^
24
26
|
25
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
27
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
28
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
26
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)
27
30
28
31
error[E0793]: reference to packed field is unaligned
@@ -31,7 +34,8 @@ error[E0793]: reference to packed field is unaligned
31
34
LL | let (_,): _ = (&p.b,);
32
35
| ^^^^
33
36
|
34
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
37
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
38
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
35
39
= 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)
36
40
37
41
error[E0793]: reference to packed field is unaligned
@@ -40,7 +44,8 @@ error[E0793]: reference to packed field is unaligned
40
44
LL | match &p.b { _ => { } }
41
45
| ^^^^
42
46
|
43
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
47
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
48
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
44
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)
45
50
46
51
error[E0793]: reference to packed field is unaligned
@@ -49,7 +54,8 @@ error[E0793]: reference to packed field is unaligned
49
54
LL | match (&p.b,) { (_,) => { } }
50
55
| ^^^^
51
56
|
52
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
57
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
58
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
53
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)
54
60
55
61
error[E0133]: access to union field is unsafe and requires unsafe function or block
Copy file name to clipboardExpand all lines: tests/ui/closures/2229_closure_analysis/diagnostics/repr_packed.stderr
+2-1
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,8 @@ error[E0793]: reference to packed field is unaligned
4
4
LL | println!("{}", foo.x);
5
5
| ^^^^^
6
6
|
7
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
7
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
8
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
8
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)
9
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.stderr
+20-10
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,8 @@ error[E0793]: reference to packed field is unaligned
4
4
LL | &self.x;
5
5
| ^^^^^^^
6
6
|
7
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
7
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
8
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
8
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)
9
10
10
11
error[E0793]: reference to packed field is unaligned
@@ -13,7 +14,8 @@ error[E0793]: reference to packed field is unaligned
13
14
LL | let _ = &good.ptr;
14
15
| ^^^^^^^^^
15
16
|
16
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
17
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
18
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
17
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)
18
20
19
21
error[E0793]: reference to packed field is unaligned
@@ -22,7 +24,8 @@ error[E0793]: reference to packed field is unaligned
22
24
LL | let _ = &good.data;
23
25
| ^^^^^^^^^^
24
26
|
25
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
27
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
28
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
26
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)
27
30
28
31
error[E0793]: reference to packed field is unaligned
@@ -31,7 +34,8 @@ error[E0793]: reference to packed field is unaligned
31
34
LL | let _ = &good.data as *const _;
32
35
| ^^^^^^^^^^
33
36
|
34
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
37
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
38
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
35
39
= 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)
36
40
37
41
error[E0793]: reference to packed field is unaligned
@@ -40,7 +44,8 @@ error[E0793]: reference to packed field is unaligned
40
44
LL | let _: *const _ = &good.data;
41
45
| ^^^^^^^^^^
42
46
|
43
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
47
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
48
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
44
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)
45
50
46
51
error[E0793]: reference to packed field is unaligned
@@ -49,7 +54,8 @@ error[E0793]: reference to packed field is unaligned
49
54
LL | let _ = good.data.clone();
50
55
| ^^^^^^^^^^^^^^^^^
51
56
|
52
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
57
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
58
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
53
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)
54
60
55
61
error[E0793]: reference to packed field is unaligned
@@ -58,7 +64,8 @@ error[E0793]: reference to packed field is unaligned
58
64
LL | let _ = &good.data2[0];
59
65
| ^^^^^^^^^^^^^^
60
66
|
61
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
67
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
68
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
62
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)
63
70
64
71
error[E0793]: reference to packed field is unaligned
@@ -67,7 +74,8 @@ error[E0793]: reference to packed field is unaligned
67
74
LL | let _ = &packed2.x;
68
75
| ^^^^^^^^^^
69
76
|
70
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
77
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
78
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
71
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)
72
80
73
81
error[E0793]: reference to packed field is unaligned
@@ -76,7 +84,8 @@ error[E0793]: reference to packed field is unaligned
76
84
LL | let _ref = &m1.1.a;
77
85
| ^^^^^^^
78
86
|
79
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
87
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
88
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
80
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)
81
90
82
91
error[E0793]: reference to packed field is unaligned
@@ -85,7 +94,8 @@ error[E0793]: reference to packed field is unaligned
85
94
LL | let _ref = &m2.1.a;
86
95
| ^^^^^^^
87
96
|
88
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
97
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
98
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
89
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)
Copy file name to clipboardExpand all lines: tests/ui/lint/unaligned_references_external_macro.stderr
+2-1
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,8 @@ LL | | }
9
9
LL | | }
10
10
| |_^
11
11
|
12
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
12
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
13
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
13
14
= 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)
14
15
= note: this error originates in the macro `unaligned_references_external_crate::mac` (in Nightly builds, run with -Z macro-backtrace for more info)
Copy file name to clipboardExpand all lines: tests/ui/packed/issue-27060.stderr
+8-4
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,8 @@ error[E0793]: reference to packed field is unaligned
4
4
LL | let _ = &good.data;
5
5
| ^^^^^^^^^^
6
6
|
7
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
7
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
8
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
8
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)
9
10
10
11
error[E0793]: reference to packed field is unaligned
@@ -13,7 +14,8 @@ error[E0793]: reference to packed field is unaligned
13
14
LL | let _ = &good.data2[0];
14
15
| ^^^^^^^^^^^^^^
15
16
|
16
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
17
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
18
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
17
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)
18
20
19
21
error[E0793]: reference to packed field is unaligned
@@ -22,7 +24,8 @@ error[E0793]: reference to packed field is unaligned
22
24
LL | let _ = &good.data;
23
25
| ^^^^^^^^^^
24
26
|
25
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
27
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
28
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
26
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)
27
30
28
31
error[E0793]: reference to packed field is unaligned
@@ -31,7 +34,8 @@ error[E0793]: reference to packed field is unaligned
31
34
LL | let _ = &good.data2[0];
32
35
| ^^^^^^^^^^^^^^
33
36
|
34
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
37
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
38
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
35
39
= 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/packed/packed-struct-borrow-element-64bit.stderr
+2-1
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,8 @@ error[E0793]: reference to packed field is unaligned
4
4
LL | let brw = &foo.baz;
5
5
| ^^^^^^^^
6
6
|
7
-
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
7
+
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
8
+
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
8
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)
0 commit comments