fork/rust

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

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

1.43.0
949 B21 linesraw
1error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
2  --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:2:3
3   |
4LL | fn foo(x:Box<dyn 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-trait-objects.rs:2:3
11   |
12LL | fn foo(x:Box<dyn 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`.