]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/union-custom-drop.rs
Merge commit '3e7c6dec244539970b593824334876f8b6ed0b18' into clippyup
[rust.git] / src / test / ui / union / union-custom-drop.rs
1 // test for a union with a field that's a union with a manual impl Drop
2 // Ensures we do not treat all unions as not having any drop glue.
3
4 #![feature(untagged_unions)]
5
6 union Foo {
7     bar: Bar, //~ ERROR unions may not contain fields that need dropping
8 }
9
10 union Bar {
11     a: i32,
12     b: u32,
13 }
14
15 impl Drop for Bar {
16     fn drop(&mut self) {}
17 }
18
19 fn main() {}