]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/borrowed-match-issue-45045.rs
fix merge conflicts
[rust.git] / src / test / ui / nll / borrowed-match-issue-45045.rs
1 // Regression test for issue #45045
2
3 #![feature(nll)]
4
5 enum Xyz {
6     A,
7     B,
8 }
9
10 fn main() {
11     let mut e = Xyz::A;
12     let f = &mut e;
13     let g = f;
14     match e {
15         Xyz::A => println!("a"),
16         //~^ cannot use `e` because it was mutably borrowed [E0503]
17         Xyz::B => println!("b"),
18     };
19     *g = Xyz::B;
20 }