rust/tests/ui/nll/match-on-borrowed.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.5 KiB
Plaintext
Raw Normal View History

error[E0503]: cannot use `e` because it was mutably borrowed
--> $DIR/match-on-borrowed.rs:47:11
|
LL | E::V(ref mut x, _) => x,
2023-01-15 03:06:44 +00:00
| --------- `e.0` is borrowed here
...
LL | match e { // Don't know that E uses a tag for its discriminant
| ^ use of borrowed `e.0`
...
LL | x;
| - borrow later used here
error[E0503]: cannot use `*f` because it was mutably borrowed
--> $DIR/match-on-borrowed.rs:61:11
|
LL | E::V(ref mut x, _) => x,
2023-01-15 03:06:44 +00:00
| --------- `f.0` is borrowed here
...
LL | match f { // Don't know that E uses a tag for its discriminant
| ^ use of borrowed `f.0`
...
LL | x;
| - borrow later used here
2018-09-13 21:04:00 +00:00
error[E0503]: cannot use `t` because it was mutably borrowed
--> $DIR/match-on-borrowed.rs:81:5
2018-09-13 21:04:00 +00:00
|
LL | let x = &mut t;
2023-01-15 03:06:44 +00:00
| ------ `t` is borrowed here
2018-09-13 21:04:00 +00:00
LL | match t {
| ^^^^^^^ use of borrowed `t`
2018-09-13 21:04:00 +00:00
...
LL | x;
| - borrow later used here
2022-06-21 22:54:17 +00:00
error[E0381]: used binding `n` isn't initialized
--> $DIR/match-on-borrowed.rs:93:11
2018-09-13 21:04:00 +00:00
|
LL | let n: Never;
2022-06-21 22:54:17 +00:00
| - binding declared here but left uninitialized
2019-03-09 12:03:44 +00:00
LL | match n {}
| ^ `n` used here but it isn't initialized
|
help: consider assigning a value
|
LL | let n: Never = todo!();
| +++++++++
2018-09-13 21:04:00 +00:00
error: aborting due to 4 previous errors
2018-09-13 21:04:00 +00:00
Some errors have detailed explanations: E0381, E0503.
2018-09-13 21:04:00 +00:00
For more information about an error, try `rustc --explain E0381`.