]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsafe/union.thir.stderr
Don't run UB in test suite
[rust.git] / src / test / ui / unsafe / union.thir.stderr
1 error[E0133]: access to union field is unsafe and requires unsafe function or block
2   --> $DIR/union.rs:30:20
3    |
4 LL |         Foo { bar: _a } => {},
5    |                    ^^ access to union field
6    |
7    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
8
9 error[E0133]: access to union field is unsafe and requires unsafe function or block
10   --> $DIR/union.rs:34:20
11    |
12 LL |               pizza: Pizza {
13    |  ____________________^
14 LL | |                 topping: Some(PizzaTopping::Cheese) | Some(PizzaTopping::Pineapple) | None
15 LL | |             }
16    | |_____________^ access to union field
17    |
18    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
19
20 error[E0133]: access to union field is unsafe and requires unsafe function or block
21   --> $DIR/union.rs:42:20
22    |
23 LL |         Foo { zst: () } => {},
24    |                    ^^ access to union field
25    |
26    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
27
28 error[E0133]: access to union field is unsafe and requires unsafe function or block
29   --> $DIR/union.rs:45:22
30    |
31 LL |         Foo { pizza: Pizza { .. } } => {},
32    |                      ^^^^^^^^^^^^ access to union field
33    |
34    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
35
36 error: aborting due to 4 previous errors
37
38 For more information about this error, try `rustc --explain E0133`.