fork/rust

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

borsAuto merge of #68568 - pietroalbini:stable-next, r=pietroalbini5e1a799842b

1.41.0
951 B22 linesraw
1error[E0596]: cannot borrow `*x.1` as mutable, as it is behind a `&` reference
2  --> $DIR/issue-61623.rs:6:19
3   |
4LL | fn f3<'a>(x: &'a ((), &'a mut ())) {
5   |              -------------------- help: consider changing this to be a mutable reference: `&'a mut ((), &'a mut ())`
6LL |     f2(|| x.0, f1(x.1))
7   |                   ^^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
8
9error[E0502]: cannot borrow `*x.1` as mutable because it is also borrowed as immutable
10  --> $DIR/issue-61623.rs:6:19
11   |
12LL |     f2(|| x.0, f1(x.1))
13   |     -- -- -       ^^^ mutable borrow occurs here
14   |     |  |  |
15   |     |  |  first borrow occurs due to use of `x` in closure
16   |     |  immutable borrow occurs here
17   |     immutable borrow later used by call
18
19error: aborting due to 2 previous errors
20
21Some errors have detailed explanations: E0502, E0596.
22For more information about an error, try `rustc --explain E0502`.