fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
959 B20 linesraw
1error[E0502]: cannot borrow `heap` as immutable because it is also borrowed as mutable
2  --> $DIR/issue-47646.rs:9:30
3   |
4LL |     let borrow = heap.peek_mut();
5   |                  ---- mutable borrow occurs here
6LL |
7LL |     match (borrow, ()) {
8   |           ------------ a temporary with access to the mutable borrow is created here ...
9LL |         (Some(_), ()) => {
10LL |             println!("{:?}", heap);
11   |                              ^^^^ immutable borrow occurs here
12...
13LL |     };
14   |      - ... and the mutable borrow might be used here, when that temporary is dropped and runs the destructor for type `(Option<PeekMut<'_, i32>>, ())`
15   |
16   = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
17
18error: aborting due to previous error
19
20For more information about this error, try `rustc --explain E0502`.