5 fn distinct_variant() {
6 let mut y = Foo::Y(1, 2);
9 Foo::Y(ref mut a, _) => a,
13 // While `a` and `b` are disjoint, borrowck doesn't know that `a` is not
14 // also used for the discriminant of `Foo`, which it would be if `a` was a
17 Foo::Y(_, ref mut b) => b,
18 //~^ ERROR cannot use `y`
27 let mut y = Foo::Y(1, 2);
30 Foo::Y(ref mut a, _) => a,
35 Foo::Y(ref mut b, _) => b, //~ ERROR cannot use `y`
36 //~| ERROR cannot borrow `y.0` as mutable