rust/tests/ui/unsafe/union-assignop.mirunsafeck.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.9 KiB
Plaintext
Raw Normal View History

2021-08-03 14:11:04 -05:00
error[E0133]: access to union field is unsafe and requires unsafe function or block
2022-06-29 21:33:18 -05:00
--> $DIR/union-assignop.rs:19:5
2021-08-03 14:11:04 -05:00
|
LL | foo.a += 5;
| ^^^^^^^^^^ access to union field
|
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
error[E0133]: access to union field is unsafe and requires unsafe function or block
2022-06-29 21:33:18 -05:00
--> $DIR/union-assignop.rs:20:6
2021-08-03 14:11:04 -05:00
|
2022-06-29 21:33:18 -05:00
LL | *foo.b += NonCopy;
| ^^^^^ access to union field
2021-08-03 14:11:04 -05:00
|
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
2022-06-29 21:33:18 -05:00
error[E0133]: access to union field is unsafe and requires unsafe function or block
--> $DIR/union-assignop.rs:21:6
2021-08-03 14:11:04 -05:00
|
2022-06-29 21:33:18 -05:00
LL | *foo.b = NonCopy;
| ^^^^^ access to union field
2021-08-03 14:11:04 -05:00
|
2022-06-29 21:33:18 -05:00
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
2021-08-03 14:11:04 -05:00
error[E0133]: access to union field is unsafe and requires unsafe function or block
--> $DIR/union-assignop.rs:23:5
|
LL | foo.a;
| ^^^^^ access to union field
|
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
error[E0133]: access to union field is unsafe and requires unsafe function or block
--> $DIR/union-assignop.rs:25:5
|
LL | foo.b;
| ^^^^^ access to union field
|
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
error[E0133]: access to union field is unsafe and requires unsafe function or block
--> $DIR/union-assignop.rs:27:13
|
LL | foo.b = foo.b;
| ^^^^^ access to union field
|
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
2022-06-29 21:33:18 -05:00
error: aborting due to 6 previous errors
2021-08-03 14:11:04 -05:00
For more information about this error, try `rustc --explain E0133`.