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
858 B19 linesraw
1error[E0594]: cannot assign to `*s.pointer` which is behind a `&` reference
2  --> $DIR/borrowck-assign-to-andmut-in-aliasable-loc.rs:9:5
3   |
4LL | fn a(s: &S) {
5   |         -- help: consider changing this to be a mutable reference: `&mut S<'_>`
6LL |     *s.pointer += 1;
7   |     ^^^^^^^^^^^^^^^ `s` is a `&` reference, so the data it refers to cannot be written
8
9error[E0594]: cannot assign to `*s.pointer` which is behind a `&` reference
10  --> $DIR/borrowck-assign-to-andmut-in-aliasable-loc.rs:17:5
11   |
12LL | fn c(s: & &mut S) {
13   |         -------- help: consider changing this to be a mutable reference: `&mut &mut S<'_>`
14LL |     *s.pointer += 1;
15   |     ^^^^^^^^^^^^^^^ `s` is a `&` reference, so the data it refers to cannot be written
16
17error: aborting due to 2 previous errors
18
19For more information about this error, try `rustc --explain E0594`.