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
error[E0793]: reference to packed field is unaligned
2
-
--> $DIR/unaligned_references.rs:20:17
2
+
--> $DIR/unaligned_references.rs:25:13
3
+
|
4
+
LL | &self.x;
5
+
| ^^^^^^^
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)
8
+
= 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
+
error[E0793]: reference to packed field is unaligned
11
+
--> $DIR/unaligned_references.rs:34:17
3
12
|
4
13
LL | let _ = &good.ptr;
5
14
| ^^^^^^^^^
@@ -8,7 +17,7 @@ LL | let _ = &good.ptr;
8
17
= 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
18
10
19
error[E0793]: reference to packed field is unaligned
11
-
--> $DIR/unaligned_references.rs:21:17
20
+
--> $DIR/unaligned_references.rs:35:17
12
21
|
13
22
LL | let _ = &good.data;
14
23
| ^^^^^^^^^^
@@ -17,7 +26,7 @@ LL | let _ = &good.data;
17
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)
18
27
19
28
error[E0793]: reference to packed field is unaligned
20
-
--> $DIR/unaligned_references.rs:23:17
29
+
--> $DIR/unaligned_references.rs:37:17
21
30
|
22
31
LL | let _ = &good.data as *const _;
23
32
| ^^^^^^^^^^
@@ -26,7 +35,7 @@ LL | let _ = &good.data as *const _;
26
35
= 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
36
28
37
error[E0793]: reference to packed field is unaligned
= 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
45
37
46
error[E0793]: reference to packed field is unaligned
38
-
--> $DIR/unaligned_references.rs:26:17
47
+
--> $DIR/unaligned_references.rs:40:17
39
48
|
40
49
LL | let _ = good.data.clone();
41
50
| ^^^^^^^^^^^^^^^^^
@@ -44,7 +53,7 @@ LL | let _ = good.data.clone();
44
53
= 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
54
46
55
error[E0793]: reference to packed field is unaligned
47
-
--> $DIR/unaligned_references.rs:28:17
56
+
--> $DIR/unaligned_references.rs:42:17
48
57
|
49
58
LL | let _ = &good.data2[0];
50
59
| ^^^^^^^^^^^^^^
@@ -53,7 +62,7 @@ LL | let _ = &good.data2[0];
53
62
= 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
63
55
64
error[E0793]: reference to packed field is unaligned
56
-
--> $DIR/unaligned_references.rs:37:17
65
+
--> $DIR/unaligned_references.rs:51:17
57
66
|
58
67
LL | let _ = &packed2.x;
59
68
| ^^^^^^^^^^
@@ -62,7 +71,7 @@ LL | let _ = &packed2.x;
62
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)
63
72
64
73
error[E0793]: reference to packed field is unaligned
65
-
--> $DIR/unaligned_references.rs:81:20
74
+
--> $DIR/unaligned_references.rs:90:20
66
75
|
67
76
LL | let _ref = &m1.1.a;
68
77
| ^^^^^^^
@@ -71,14 +80,14 @@ LL | let _ref = &m1.1.a;
71
80
= 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
81
73
82
error[E0793]: reference to packed field is unaligned
74
-
--> $DIR/unaligned_references.rs:90:20
83
+
--> $DIR/unaligned_references.rs:93:20
75
84
|
76
85
LL | let _ref = &m2.1.a;
77
86
| ^^^^^^^
78
87
|
79
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)
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
-
error: aborting due to 9 previous errors
91
+
error: aborting due to 10 previous errors
83
92
84
93
For more information about this error, try `rustc --explain E0793`.
0 commit comments