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: src/test/ui/binding/issue-53114-safety-checks.stderr
+4
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ LL | let _ = &p.b;
8
8
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
9
9
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
10
10
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
11
+
= 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)
11
12
12
13
warning: reference to packed field is unaligned
13
14
--> $DIR/issue-53114-safety-checks.rs:29:17
@@ -18,6 +19,7 @@ LL | let (_,) = (&p.b,);
18
19
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
19
20
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
20
21
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
22
+
= 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)
21
23
22
24
warning: reference to packed field is unaligned
23
25
--> $DIR/issue-53114-safety-checks.rs:39:11
@@ -28,6 +30,7 @@ LL | match &p.b { _ => { } }
28
30
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
29
31
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
30
32
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
33
+
= 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)
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
39
42
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
40
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)
44
+
= 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)
41
45
42
46
error[E0133]: access to union field is unsafe and requires unsafe function or block
Copy file name to clipboardExpand all lines: src/test/ui/closures/2229_closure_analysis/diagnostics/repr_packed.stderr
+1
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ LL | println!("{}", foo.x);
8
8
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
9
9
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
10
10
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
11
+
= 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)
11
12
= note: this warning originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
13
13
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
14
14
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
15
+
= 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)
15
16
16
17
error: reference to packed field is unaligned
17
18
--> $DIR/unaligned_references.rs:24:17
@@ -22,6 +23,7 @@ LL | let _ = &good.data;
22
23
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
23
24
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
24
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)
26
+
= 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)
25
27
26
28
error: reference to packed field is unaligned
27
29
--> $DIR/unaligned_references.rs:27:17
@@ -32,6 +34,7 @@ LL | let _ = &good.data as *const _;
32
34
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
33
35
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
34
36
= 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
+
= 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)
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
43
46
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
44
47
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
48
+
= 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
49
46
50
error: reference to packed field is unaligned
47
51
--> $DIR/unaligned_references.rs:32:17
@@ -52,6 +56,7 @@ LL | let _ = good.data.clone();
52
56
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
53
57
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
54
58
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
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)
55
60
56
61
error: reference to packed field is unaligned
57
62
--> $DIR/unaligned_references.rs:35:17
@@ -62,6 +67,7 @@ LL | let _ = &good.data2[0];
62
67
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
63
68
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
64
69
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
70
+
= 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)
65
71
66
72
error: reference to packed field is unaligned
67
73
--> $DIR/unaligned_references.rs:45:17
@@ -72,6 +78,7 @@ LL | let _ = &packed2.x;
72
78
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
73
79
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
74
80
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
81
+
= 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: src/test/ui/lint/unaligned_references_external_macro.stderr
+1
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,7 @@ LL | | }
24
24
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
25
25
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
26
26
= 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
+
= 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
28
= note: this error originates in the macro `unaligned_references_external_crate::mac` (in Nightly builds, run with -Z macro-backtrace for more info)
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
13
13
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
14
14
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
15
+
= 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)
15
16
16
17
error: reference to packed field is unaligned
17
18
--> $DIR/issue-27060.rs:18:13
@@ -22,6 +23,7 @@ LL | let _ = &good.data2[0];
22
23
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
23
24
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
24
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)
26
+
= 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)
25
27
26
28
error: reference to packed field is unaligned
27
29
--> $DIR/issue-27060.rs:21:13
@@ -32,6 +34,7 @@ LL | let _ = &good.data;
32
34
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
33
35
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
34
36
= 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
+
= 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)
35
38
36
39
error: reference to packed field is unaligned
37
40
--> $DIR/issue-27060.rs:23:13
@@ -42,6 +45,7 @@ LL | let _ = &good.data2[0];
42
45
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
43
46
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
44
47
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
48
+
= 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: src/test/ui/packed/packed-struct-borrow-element-64bit.stderr
+1
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ LL | let brw = &foo.baz;
8
8
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
9
9
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
10
10
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
11
+
= 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: src/test/ui/packed/packed-struct-borrow-element.stderr
+2
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ LL | let brw = &foo.baz;
8
8
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
9
9
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
10
10
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
11
+
= 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)
11
12
12
13
warning: reference to packed field is unaligned
13
14
--> $DIR/packed-struct-borrow-element.rs:30:15
@@ -18,6 +19,7 @@ LL | let brw = &foo.baz;
18
19
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
19
20
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
20
21
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
22
+
= 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