]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/closures/2229_closure_analysis/pattern-matching-should-fail.rs
1 #![feature(capture_disjoint_fields)]
2 //~^ WARNING: the feature `capture_disjoint_fields` is incomplete
3 //~| `#[warn(incomplete_features)]` on by default
4 //~| see issue #53488 <https://github.com/rust-lang/rust/issues/53488>
5 #![feature(never_type)]
7 // Should fake read the discriminant and throw an error
10 let c1
= || match x { }
;
11 //~^ ERROR: use of possibly-uninitialized variable: `x`
14 // Should fake read the discriminant and throw an error
17 let c2
= || match x { _ => () }
;
18 //~^ ERROR: borrow of possibly-uninitialized variable: `x`
21 // Testing single variant patterns
26 // Should fake read the discriminant and throw an error
30 //~^ ERROR: borrow of possibly-uninitialized variable: `variant`
32 SingleVariant
::Points(_
) => {}
38 // Should fake read the discriminant and throw an error
42 //~^ ERROR: borrow of possibly-uninitialized variable: `variant`
44 SingleVariant
::Points(a
) => {
58 //~^ ERROR: use of possibly-uninitialized variable: `g`
61 //~^ ERROR: use of possibly-uninitialized variable: `t`
69 // Should fake read the discriminant and throw an error
72 let c1
= || match x { }
;
73 //~^ ERROR: use of possibly-uninitialized variable: `x`
74 //~| ERROR: non-exhaustive patterns: type `u8` is non-empty