]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/union-unsafe.thir.stderr
Rollup merge of #93385 - CraftSpider:rustdoc-ty-fixes, r=camelid
[rust.git] / src / test / ui / union / union-unsafe.thir.stderr
1 error[E0133]: access to union field is unsafe and requires unsafe function or block
2   --> $DIR/union-unsafe.rs:34:6
3    |
4 LL |     *(u.p) = 13;
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]: assignment to union field that might need dropping is unsafe and requires unsafe function or block
10   --> $DIR/union-unsafe.rs:39:5
11    |
12 LL |     u.a = (RefCell::new(0), 1);
13    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to union field that might need dropping
14    |
15    = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized
16
17 error[E0133]: assignment to union field that might need dropping is unsafe and requires unsafe function or block
18   --> $DIR/union-unsafe.rs:40:5
19    |
20 LL |     u.a.0 = RefCell::new(0);
21    |     ^^^^^^^^^^^^^^^^^^^^^^^ assignment to union field that might need dropping
22    |
23    = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized
24
25 error[E0133]: access to union field is unsafe and requires unsafe function or block
26   --> $DIR/union-unsafe.rs:47:6
27    |
28 LL |     *u3.a = T::default();
29    |      ^^^^ access to union field
30    |
31    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
32
33 error[E0133]: access to union field is unsafe and requires unsafe function or block
34   --> $DIR/union-unsafe.rs:53:6
35    |
36 LL |     *u3.a = T::default();
37    |      ^^^^ access to union field
38    |
39    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
40
41 error[E0133]: access to union field is unsafe and requires unsafe function or block
42   --> $DIR/union-unsafe.rs:61:13
43    |
44 LL |     let a = u1.a;
45    |             ^^^^ access to union field
46    |
47    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
48
49 error[E0133]: access to union field is unsafe and requires unsafe function or block
50   --> $DIR/union-unsafe.rs:64:14
51    |
52 LL |     let U1 { a } = u1;
53    |              ^ access to union field
54    |
55    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
56
57 error[E0133]: access to union field is unsafe and requires unsafe function or block
58   --> $DIR/union-unsafe.rs:65:8
59    |
60 LL |     if let U1 { a: 12 } = u1 {}
61    |        ^^^^^^^^^^^^^^^^^^^^^ access to union field
62    |
63    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
64
65 error[E0133]: access to union field is unsafe and requires unsafe function or block
66   --> $DIR/union-unsafe.rs:70:6
67    |
68 LL |     *u2.a = String::from("new");
69    |      ^^^^ access to union field
70    |
71    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
72
73 error[E0133]: access to union field is unsafe and requires unsafe function or block
74   --> $DIR/union-unsafe.rs:74:6
75    |
76 LL |     *u3.a = 1;
77    |      ^^^^ access to union field
78    |
79    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
80
81 error[E0133]: access to union field is unsafe and requires unsafe function or block
82   --> $DIR/union-unsafe.rs:78:6
83    |
84 LL |     *u3.a = String::from("new");
85    |      ^^^^ access to union field
86    |
87    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
88
89 error: aborting due to 11 previous errors
90
91 For more information about this error, try `rustc --explain E0133`.