rust/src/test/ui/span/mut-arg-hint.stderr

28 lines
1.1 KiB
Plaintext
Raw Normal View History

2017-05-27 12:58:52 -05:00
error[E0596]: cannot borrow immutable borrowed content `*a` as mutable
--> $DIR/mut-arg-hint.rs:13:9
|
2018-02-22 18:42:32 -06:00
LL | fn foo(mut a: &String) {
| ------- use `&mut String` here to make mutable
2018-02-22 18:42:32 -06:00
LL | a.push_str("bar"); //~ ERROR cannot borrow immutable borrowed content
| ^ cannot borrow as mutable
2017-05-27 12:58:52 -05:00
error[E0596]: cannot borrow immutable borrowed content `*a` as mutable
--> $DIR/mut-arg-hint.rs:18:5
|
2018-02-22 18:42:32 -06:00
LL | pub fn foo<'a>(mut a: &'a String) {
| ---------- use `&'a mut String` here to make mutable
2018-02-22 18:42:32 -06:00
LL | a.push_str("foo"); //~ ERROR cannot borrow immutable borrowed content
| ^ cannot borrow as mutable
2017-05-27 12:58:52 -05:00
error[E0596]: cannot borrow immutable borrowed content `*a` as mutable
--> $DIR/mut-arg-hint.rs:25:9
|
2018-02-22 18:42:32 -06:00
LL | pub fn foo(mut a: &String) {
| ------- use `&mut String` here to make mutable
2018-02-22 18:42:32 -06:00
LL | a.push_str("foo"); //~ ERROR cannot borrow immutable borrowed content
| ^ cannot borrow as mutable
error: aborting due to 3 previous errors
2018-03-03 08:59:40 -06:00
For more information about this error, try `rustc --explain E0596`.