rust/tests/ui/pattern/usefulness/conflicting_bindings.stderr
2023-11-02 03:19:19 +01:00

67 lines
2.6 KiB
Plaintext

error: cannot borrow value as mutable more than once at a time
--> $DIR/conflicting_bindings.rs:5:9
|
LL | let ref mut y @ ref mut z = x;
| ^^^^^^^^^ --------- value is mutably borrowed by `z` here
| |
| value is mutably borrowed by `y` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/conflicting_bindings.rs:7:14
|
LL | let Some(ref mut y @ ref mut z) = x else { return };
| ^^^^^^^^^ --------- value is mutably borrowed by `z` here
| |
| value is mutably borrowed by `y` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/conflicting_bindings.rs:9:17
|
LL | if let Some(ref mut y @ ref mut z) = x {}
| ^^^^^^^^^ --------- value is mutably borrowed by `z` here
| |
| value is mutably borrowed by `y` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/conflicting_bindings.rs:11:17
|
LL | if let Some(ref mut y @ ref mut z) = x && true {}
| ^^^^^^^^^ --------- value is mutably borrowed by `z` here
| |
| value is mutably borrowed by `y` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/conflicting_bindings.rs:13:20
|
LL | while let Some(ref mut y @ ref mut z) = x {}
| ^^^^^^^^^ --------- value is mutably borrowed by `z` here
| |
| value is mutably borrowed by `y` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/conflicting_bindings.rs:15:20
|
LL | while let Some(ref mut y @ ref mut z) = x && true {}
| ^^^^^^^^^ --------- value is mutably borrowed by `z` here
| |
| value is mutably borrowed by `y` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/conflicting_bindings.rs:18:9
|
LL | ref mut y @ ref mut z => {}
| ^^^^^^^^^ --------- value is mutably borrowed by `z` here
| |
| value is mutably borrowed by `y` here
error: cannot borrow value as mutable more than once at a time
--> $DIR/conflicting_bindings.rs:21:24
|
LL | () if let Some(ref mut y @ ref mut z) = x => {}
| ^^^^^^^^^ --------- value is mutably borrowed by `z` here
| |
| value is mutably borrowed by `y` here
error: aborting due to 8 previous errors