rust/src/test/ui/issues/issue-47646.rs
2018-12-25 21:08:33 -07:00

16 lines
342 B
Rust

#![allow(warnings)]
#![feature(nll)]
use std::collections::BinaryHeap;
fn main() {
let mut heap: BinaryHeap<i32> = BinaryHeap::new();
let borrow = heap.peek_mut();
match (borrow, ()) {
(Some(_), ()) => {
println!("{:?}", heap); //~ ERROR cannot borrow `heap` as immutable
}
_ => {}
};
}