]> git.proxmox.com Git - rustc.git/blame - src/test/ui/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.stderr
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / borrowck / borrowck-assign-to-andmut-in-aliasable-loc.stderr
CommitLineData
136023e0 1error[E0594]: cannot assign to `*s.pointer`, which is behind a `&` reference
0731742a 2 --> $DIR/borrowck-assign-to-andmut-in-aliasable-loc.rs:9:5
b7449926
XL
3 |
4LL | fn a(s: &S) {
48663c56 5 | -- help: consider changing this to be a mutable reference: `&mut S<'_>`
532ac7d7 6LL | *s.pointer += 1;
48663c56 7 | ^^^^^^^^^^^^^^^ `s` is a `&` reference, so the data it refers to cannot be written
b7449926 8
136023e0 9error[E0594]: cannot assign to `*s.pointer`, which is behind a `&` reference
0731742a 10 --> $DIR/borrowck-assign-to-andmut-in-aliasable-loc.rs:17:5
b7449926
XL
11 |
12LL | fn c(s: & &mut S) {
48663c56 13 | -------- help: consider changing this to be a mutable reference: `&mut &mut S<'_>`
532ac7d7 14LL | *s.pointer += 1;
48663c56 15 | ^^^^^^^^^^^^^^^ `s` is a `&` reference, so the data it refers to cannot be written
b7449926
XL
16
17error: aborting due to 2 previous errors
18
60c5eb7d 19For more information about this error, try `rustc --explain E0594`.