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
= 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
21
21
error[E0793]: reference to packed field is unaligned
22
-
--> $DIR/unaligned_references.rs:47:17
22
+
--> $DIR/unaligned_references.rs:42:24
23
+
|
24
+
LL | println!("{:?}", &*foo.0);
25
+
| ^^^^^
26
+
|
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)
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
+
31
+
error[E0793]: reference to packed field is unaligned
32
+
--> $DIR/unaligned_references.rs:47:24
33
+
|
34
+
LL | println!("{:?}", &*foo.0);
35
+
| ^^^^^
36
+
|
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)
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)
40
+
41
+
error[E0793]: reference to packed field is unaligned
42
+
--> $DIR/unaligned_references.rs:57:17
23
43
|
24
44
LL | let _ = &good.ptr;
25
45
| ^^^^^^^^^
@@ -29,7 +49,7 @@ LL | let _ = &good.ptr;
29
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)
30
50
31
51
error[E0793]: reference to packed field is unaligned
32
-
--> $DIR/unaligned_references.rs:48:17
52
+
--> $DIR/unaligned_references.rs:58:17
33
53
|
34
54
LL | let _ = &good.data;
35
55
| ^^^^^^^^^^
@@ -39,7 +59,7 @@ LL | let _ = &good.data;
39
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)
40
60
41
61
error[E0793]: reference to packed field is unaligned
42
-
--> $DIR/unaligned_references.rs:50:17
62
+
--> $DIR/unaligned_references.rs:60:17
43
63
|
44
64
LL | let _ = &good.data as *const _;
45
65
| ^^^^^^^^^^
@@ -49,7 +69,7 @@ LL | let _ = &good.data as *const _;
49
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)
50
70
51
71
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)
60
80
61
81
error[E0793]: reference to packed field is unaligned
62
-
--> $DIR/unaligned_references.rs:53:17
82
+
--> $DIR/unaligned_references.rs:63:17
63
83
|
64
84
LL | let _ = good.data.clone();
65
85
| ^^^^^^^^^
@@ -69,7 +89,7 @@ LL | let _ = good.data.clone();
69
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)
70
90
71
91
error[E0793]: reference to packed field is unaligned
72
-
--> $DIR/unaligned_references.rs:55:17
92
+
--> $DIR/unaligned_references.rs:65:17
73
93
|
74
94
LL | let _ = &good.data2[0];
75
95
| ^^^^^^^^^^^^^^
@@ -79,7 +99,7 @@ LL | let _ = &good.data2[0];
79
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)
80
100
81
101
error[E0793]: reference to packed field is unaligned
82
-
--> $DIR/unaligned_references.rs:64:17
102
+
--> $DIR/unaligned_references.rs:74:17
83
103
|
84
104
LL | let _ = &packed2.x;
85
105
| ^^^^^^^^^^
@@ -89,7 +109,7 @@ LL | let _ = &packed2.x;
89
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)
90
110
91
111
error[E0793]: reference to packed field is unaligned
92
-
--> $DIR/unaligned_references.rs:103:20
112
+
--> $DIR/unaligned_references.rs:113:20
93
113
|
94
114
LL | let _ref = &m1.1.a;
95
115
| ^^^^^^^
@@ -99,7 +119,7 @@ LL | let _ref = &m1.1.a;
99
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)
100
120
101
121
error[E0793]: reference to packed field is unaligned
102
-
--> $DIR/unaligned_references.rs:106:20
122
+
--> $DIR/unaligned_references.rs:116:20
103
123
|
104
124
LL | let _ref = &m2.1.a;
105
125
| ^^^^^^^
@@ -108,6 +128,6 @@ LL | let _ref = &m2.1.a;
108
128
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
109
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)
110
130
111
-
error: aborting due to 11 previous errors
131
+
error: aborting due to 13 previous errors
112
132
113
133
For more information about this error, try `rustc --explain E0793`.
0 commit comments