]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/match-cfg-fake-edges2.rs
Rollup merge of #83807 - sjakobi:77548-remove-ignore-annotations, r=Mark-Simulacrum
[rust.git] / src / test / ui / nll / match-cfg-fake-edges2.rs
1 // Test that we have enough false edges to avoid exposing the exact matching
2 // algorithm in borrow checking.
3
4 #![feature(nll)]
5
6 fn all_previous_tests_may_be_done(y: &mut (bool, bool)) {
7     let r = &mut y.1;
8     // We don't actually test y.1 to select the second arm, but we don't want
9     // borrowck results to be based on the order we match patterns.
10     match y {
11         (false, true) => 1, //~ ERROR cannot use `y.1` because it was mutably borrowed
12         (true, _) => {
13             r;
14             2
15         }
16         (false, _) => 3,
17     };
18 }
19
20 fn main() {}