]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/issue-85581.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / issue-85581.rs
1 // Regression test of #85581.
2 // Checks not to suggest to add `;` when the second mutable borrow
3 // is in the first's scope.
4
5 use std::collections::BinaryHeap;
6
7 fn foo(heap: &mut BinaryHeap<i32>) {
8     match heap.peek_mut() {
9         Some(_) => { heap.pop(); },
10         //~^ ERROR: cannot borrow `*heap` as mutable more than once at a time
11         None => (),
12     }
13 }
14
15 fn main() {}