fork/rust

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

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
790 B18 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