]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/union-with-drop-fields-lint-rpass.rs
Auto merge of #62766 - alexcrichton:stabilize-pipelined-compilation, r=oli-obk
[rust.git] / src / test / ui / union / union-with-drop-fields-lint-rpass.rs
1 // run-pass
2
3 #![feature(untagged_unions)]
4 #![allow(dead_code)]
5 #![allow(unions_with_drop_fields)]
6
7 union U {
8     a: u8, // OK
9 }
10
11 union W {
12     a: String, // OK
13     b: String, // OK
14 }
15
16 struct S(String);
17
18 // `S` doesn't implement `Drop` trait, but still has non-trivial destructor
19 union Y {
20     a: S, // OK
21 }
22
23 // We don't know if `T` is trivially-destructable or not until trans
24 union J<T> {
25     a: T, // OK
26 }
27
28 union H<T: Copy> {
29     a: T, // OK
30 }
31
32 fn main() {}