]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/match-cfg-fake-edges2.rs
Auto merge of #105145 - Ayush1325:sequential-remote-server, 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 fn all_previous_tests_may_be_done(y: &mut (bool, bool)) {
5     let r = &mut y.1;
6     // We don't actually test y.1 to select the second arm, but we don't want
7     // borrowck results to be based on the order we match patterns.
8     match y { //~ ERROR cannot use `y.1` because it was mutably borrowed
9         (false, true) => 1,
10         (true, _) => {
11             r;
12             2
13         }
14         (false, _) => 3,
15     };
16 }
17
18 fn main() {}