diff options
Diffstat (limited to 'tests/ui/unsafe/union.rs')
| -rw-r--r-- | tests/ui/unsafe/union.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/ui/unsafe/union.rs b/tests/ui/unsafe/union.rs index 83ec1c3cd6c..ae81708aa19 100644 --- a/tests/ui/unsafe/union.rs +++ b/tests/ui/unsafe/union.rs @@ -26,20 +26,19 @@ pub fn main() { match foo { Foo { bar: _a } => {}, //~ ERROR access to union field is unsafe } - match foo { //~ ERROR access to union field is unsafe + match foo { Foo { - pizza: Pizza { + pizza: Pizza { //~ ERROR access to union field is unsafe topping: Some(PizzaTopping::Cheese) | Some(PizzaTopping::Pineapple) | None } } => {}, } - // MIR unsafeck incorrectly thinks that no unsafe block is needed to do these match foo { - Foo { zst: () } => {}, + Foo { zst: () } => {} //~ ERROR access to union field is unsafe } match foo { - Foo { pizza: Pizza { .. } } => {}, + Foo { pizza: Pizza { .. } } => {} //~ ERROR access to union field is unsafe } // binding to wildcard is okay |
