fork/rust

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

borsAuto merge of #69444 - pietroalbini:stable-next-final-v2-new, r=pietroalbinif3e1a954d2e

1.41.1
879 B21 linesraw
1error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
2  --> $DIR/ex3-both-anon-regions-using-fn-items.rs:2:3
3   |
4LL | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
5   |                        - help: consider changing this to be mutable: `mut y`
6LL |   y.push(z);
7   |   ^ cannot borrow as mutable
8
9error: lifetime may not live long enough
10  --> $DIR/ex3-both-anon-regions-using-fn-items.rs:2:3
11   |
12LL | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
13   |                               -        - let's call the lifetime of this reference `'1`
14   |                               |
15   |                               let's call the lifetime of this reference `'2`
16LL |   y.push(z);
17   |   ^^^^^^^^^ argument requires that `'1` must outlive `'2`
18
19error: aborting due to 2 previous errors
20
21For more information about this error, try `rustc --explain E0596`.