walk the bodies "in order" by traversing the crate
Otherwise the errors from borrowck come out in an unpredictable order.
This commit is contained in:
parent
3e9bddad7b
commit
d79ad36cf5
3 changed files with 50 additions and 23 deletions
|
|
@ -1,11 +1,3 @@
|
|||
error: cannot borrow immutable borrowed content `*a` as mutable
|
||||
--> $DIR/mut-arg-hint.rs:18:5
|
||||
|
|
||||
17 | pub fn foo<'a>(mut a: &'a String) {
|
||||
| ---------- use `&'a mut String` here to make mutable
|
||||
18 | a.push_str("foo");
|
||||
| ^ cannot borrow as mutable
|
||||
|
||||
error: cannot borrow immutable borrowed content `*a` as mutable
|
||||
--> $DIR/mut-arg-hint.rs:13:9
|
||||
|
|
||||
|
|
@ -14,6 +6,14 @@ error: cannot borrow immutable borrowed content `*a` as mutable
|
|||
13 | a.push_str("bar");
|
||||
| ^ cannot borrow as mutable
|
||||
|
||||
error: cannot borrow immutable borrowed content `*a` as mutable
|
||||
--> $DIR/mut-arg-hint.rs:18:5
|
||||
|
|
||||
17 | pub fn foo<'a>(mut a: &'a String) {
|
||||
| ---------- use `&'a mut String` here to make mutable
|
||||
18 | a.push_str("foo");
|
||||
| ^ cannot borrow as mutable
|
||||
|
||||
error: cannot borrow immutable borrowed content `*a` as mutable
|
||||
--> $DIR/mut-arg-hint.rs:25:9
|
||||
|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue