os-rust/src/test/ui/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.stderr

20 lines
738 B
Text
Raw Normal View History

2018-08-08 14:28:26 +02:00
error[E0389]: cannot assign to data in a `&` reference
2018-12-25 08:56:47 -07:00
--> $DIR/borrowck-assign-to-andmut-in-aliasable-loc.rs:9:5
2018-08-08 14:28:26 +02:00
|
LL | fn a(s: &S) {
| -- use `&mut S` here to make mutable
LL | *s.pointer += 1; //~ ERROR cannot assign
| ^^^^^^^^^^^^^^^ assignment into an immutable reference
error[E0389]: cannot assign to data in a `&` reference
2018-12-25 08:56:47 -07:00
--> $DIR/borrowck-assign-to-andmut-in-aliasable-loc.rs:17:5
2018-08-08 14:28:26 +02:00
|
LL | fn c(s: & &mut S) {
| -------- use `&mut &mut S` here to make mutable
LL | *s.pointer += 1; //~ ERROR cannot assign
| ^^^^^^^^^^^^^^^ assignment into an immutable reference
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0389`.