2020-02-02 17:58:15 +01:00
|
|
|
error: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:28:9
|
2019-12-15 00:32:20 +01:00
|
|
|
|
|
|
|
|
LL | let ref mut a @ ref mut b = U;
|
|
|
|
| ---------^^^---------
|
|
|
|
| | |
|
2020-02-02 17:58:15 +01:00
|
|
|
| | another mutable borrow, by `b`, occurs here
|
|
|
|
| first mutable borrow, by `a`, occurs here
|
2019-12-15 00:32:20 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:32:9
|
2019-12-15 00:32:20 +01:00
|
|
|
|
|
|
|
|
LL | let ref mut a @ ref mut b = U;
|
|
|
|
| ---------^^^---------
|
|
|
|
| | |
|
2020-02-02 17:58:15 +01:00
|
|
|
| | another mutable borrow, by `b`, occurs here
|
|
|
|
| first mutable borrow, by `a`, occurs here
|
2019-12-15 00:32:20 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:35:9
|
2019-12-15 00:32:20 +01:00
|
|
|
|
|
|
|
|
LL | let ref mut a @ ref mut b = U;
|
|
|
|
| ---------^^^---------
|
|
|
|
| | |
|
2020-02-02 17:58:15 +01:00
|
|
|
| | another mutable borrow, by `b`, occurs here
|
|
|
|
| first mutable borrow, by `a`, occurs here
|
2019-12-15 00:32:20 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:38:9
|
2019-12-15 00:32:20 +01:00
|
|
|
|
|
|
|
|
LL | let ref mut a @ ref mut b = U;
|
|
|
|
| ---------^^^---------
|
|
|
|
| | |
|
2020-02-02 17:58:15 +01:00
|
|
|
| | another mutable borrow, by `b`, occurs here
|
|
|
|
| first mutable borrow, by `a`, occurs here
|
2019-12-15 00:32:20 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:42:9
|
2019-12-15 00:32:20 +01:00
|
|
|
|
|
|
|
|
LL | let ref mut a @ ref mut b = U;
|
|
|
|
| ---------^^^---------
|
|
|
|
| | |
|
2020-02-02 17:58:15 +01:00
|
|
|
| | another mutable borrow, by `b`, occurs here
|
|
|
|
| first mutable borrow, by `a`, occurs here
|
2019-12-15 00:32:20 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:46:9
|
2019-12-15 00:32:20 +01:00
|
|
|
|
|
|
|
|
LL | let ref mut a @ (
|
|
|
|
| ^--------
|
|
|
|
| |
|
2020-02-02 17:58:15 +01:00
|
|
|
| _________first mutable borrow, by `a`, occurs here
|
2019-12-15 00:32:20 +01:00
|
|
|
| |
|
|
|
|
LL | |
|
|
|
|
LL | | ref mut b,
|
2020-02-02 17:58:15 +01:00
|
|
|
| | --------- another mutable borrow, by `b`, occurs here
|
2019-12-15 00:32:20 +01:00
|
|
|
LL | | [
|
|
|
|
LL | | ref mut c,
|
2020-02-02 17:58:15 +01:00
|
|
|
| | --------- another mutable borrow, by `c`, occurs here
|
2019-12-15 00:32:20 +01:00
|
|
|
LL | | ref mut d,
|
2020-02-02 17:58:15 +01:00
|
|
|
| | --------- another mutable borrow, by `d`, occurs here
|
2019-12-15 00:32:20 +01:00
|
|
|
LL | | ref e,
|
2020-02-02 17:58:15 +01:00
|
|
|
| | ----- also borrowed as immutable, by `e`, here
|
2019-12-15 00:32:20 +01:00
|
|
|
LL | | ]
|
|
|
|
LL | | ) = (U, [U, U, U]);
|
|
|
|
| |_____^
|
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:56:9
|
2019-12-15 00:50:44 +01:00
|
|
|
|
|
|
|
|
LL | let ref mut a @ (
|
|
|
|
| ^--------
|
|
|
|
| |
|
2020-02-02 17:58:15 +01:00
|
|
|
| _________first mutable borrow, by `a`, occurs here
|
2019-12-15 00:50:44 +01:00
|
|
|
| |
|
|
|
|
LL | |
|
|
|
|
LL | | ref mut b,
|
2020-02-02 17:58:15 +01:00
|
|
|
| | --------- another mutable borrow, by `b`, occurs here
|
2019-12-15 00:50:44 +01:00
|
|
|
LL | | [
|
|
|
|
LL | | ref mut c,
|
2020-02-02 17:58:15 +01:00
|
|
|
| | --------- another mutable borrow, by `c`, occurs here
|
2019-12-15 00:50:44 +01:00
|
|
|
LL | | ref mut d,
|
2020-02-02 17:58:15 +01:00
|
|
|
| | --------- another mutable borrow, by `d`, occurs here
|
2019-12-15 00:50:44 +01:00
|
|
|
LL | | ref e,
|
2020-02-02 17:58:15 +01:00
|
|
|
| | ----- also borrowed as immutable, by `e`, here
|
2019-12-15 00:50:44 +01:00
|
|
|
LL | | ]
|
|
|
|
LL | | ) = (u(), [u(), u(), u()]);
|
|
|
|
| |_________^
|
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: borrow of moved value
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:66:9
|
2019-11-11 11:39:52 +01:00
|
|
|
|
|
|
|
|
LL | let a @ (ref mut b, ref mut c) = (U, U);
|
2020-01-19 02:47:01 +01:00
|
|
|
| -^^^^---------^^---------^
|
|
|
|
| | | |
|
|
|
|
| | | value borrowed here after move
|
|
|
|
| | value borrowed here after move
|
2020-02-02 17:58:15 +01:00
|
|
|
| value moved into `a` here
|
2020-02-21 14:49:51 +01:00
|
|
|
| move occurs because `a` has type `(main::U, main::U)` which does not implement the `Copy` trait
|
2019-11-11 11:39:52 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: borrow of moved value
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:70:9
|
2019-11-11 11:39:52 +01:00
|
|
|
|
|
|
|
|
LL | let a @ (b, [c, d]) = &mut val; // Same as ^--
|
2020-01-19 02:47:01 +01:00
|
|
|
| -^^^^-^^^-^^-^^
|
|
|
|
| | | | |
|
|
|
|
| | | | value borrowed here after move
|
|
|
|
| | | value borrowed here after move
|
|
|
|
| | value borrowed here after move
|
2020-02-02 17:58:15 +01:00
|
|
|
| value moved into `a` here
|
2020-02-21 14:49:51 +01:00
|
|
|
| move occurs because `a` has type `&mut (main::U, [main::U; 2])` which does not implement the `Copy` trait
|
2019-11-11 11:39:52 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: borrow of moved value
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:74:9
|
2019-11-11 11:39:52 +01:00
|
|
|
|
|
|
|
|
LL | let a @ &mut ref mut b = &mut U;
|
2020-01-19 02:47:01 +01:00
|
|
|
| -^^^^^^^^---------
|
|
|
|
| | |
|
|
|
|
| | value borrowed here after move
|
2020-02-02 17:58:15 +01:00
|
|
|
| value moved into `a` here
|
2020-02-21 14:49:51 +01:00
|
|
|
| move occurs because `a` has type `&mut main::U` which does not implement the `Copy` trait
|
2019-11-11 11:39:52 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: borrow of moved value
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:77:9
|
2019-11-11 11:39:52 +01:00
|
|
|
|
|
|
|
|
LL | let a @ &mut (ref mut b, ref mut c) = &mut (U, U);
|
2020-01-19 02:47:01 +01:00
|
|
|
| -^^^^^^^^^---------^^---------^
|
|
|
|
| | | |
|
|
|
|
| | | value borrowed here after move
|
|
|
|
| | value borrowed here after move
|
2020-02-02 17:58:15 +01:00
|
|
|
| value moved into `a` here
|
2020-02-21 14:49:51 +01:00
|
|
|
| move occurs because `a` has type `&mut (main::U, main::U)` which does not implement the `Copy` trait
|
2019-11-11 11:39:52 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:82:9
|
2019-12-15 00:32:20 +01:00
|
|
|
|
|
|
|
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
|
|
|
|
| ---------^^^^^^---------^
|
|
|
|
| | |
|
2020-02-02 17:58:15 +01:00
|
|
|
| | another mutable borrow, by `b`, occurs here
|
|
|
|
| first mutable borrow, by `a`, occurs here
|
2019-12-15 00:32:20 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:82:37
|
2019-12-15 00:32:20 +01:00
|
|
|
|
|
|
|
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
|
|
|
|
| ---------^^^^^^^---------^
|
|
|
|
| | |
|
2020-02-02 17:58:15 +01:00
|
|
|
| | another mutable borrow, by `b`, occurs here
|
|
|
|
| first mutable borrow, by `a`, occurs here
|
2019-12-15 00:32:20 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:88:9
|
2019-12-15 00:32:20 +01:00
|
|
|
|
|
|
|
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
|
|
|
|
| ---------^^^^^^---------^
|
|
|
|
| | |
|
2020-02-02 17:58:15 +01:00
|
|
|
| | another mutable borrow, by `b`, occurs here
|
|
|
|
| first mutable borrow, by `a`, occurs here
|
2019-12-15 00:32:20 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:88:37
|
2019-12-15 00:32:20 +01:00
|
|
|
|
|
|
|
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
|
|
|
|
| ---------^^^^^^^---------^
|
|
|
|
| | |
|
2020-02-02 17:58:15 +01:00
|
|
|
| | another mutable borrow, by `b`, occurs here
|
|
|
|
| first mutable borrow, by `a`, occurs here
|
2019-12-15 00:32:20 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:95:9
|
2019-12-15 00:32:20 +01:00
|
|
|
|
|
|
|
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
|
|
|
|
| ---------^^^^^^---------^
|
|
|
|
| | |
|
2020-02-02 17:58:15 +01:00
|
|
|
| | another mutable borrow, by `b`, occurs here
|
|
|
|
| first mutable borrow, by `a`, occurs here
|
2019-12-15 00:32:20 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:95:37
|
2019-12-15 00:32:20 +01:00
|
|
|
|
|
|
|
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
|
|
|
|
| ---------^^^^^^^---------^
|
|
|
|
| | |
|
2020-02-02 17:58:15 +01:00
|
|
|
| | another mutable borrow, by `b`, occurs here
|
|
|
|
| first mutable borrow, by `a`, occurs here
|
2019-12-15 00:32:20 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:107:9
|
2019-12-15 00:32:20 +01:00
|
|
|
|
|
|
|
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
|
|
|
|
| ---------^^^^^^---------^
|
|
|
|
| | |
|
2020-02-02 17:58:15 +01:00
|
|
|
| | another mutable borrow, by `b`, occurs here
|
|
|
|
| first mutable borrow, by `a`, occurs here
|
2019-12-15 00:32:20 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:107:37
|
2019-12-15 00:32:20 +01:00
|
|
|
|
|
|
|
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
|
|
|
|
| ---------^^^^^^^---------^
|
|
|
|
| | |
|
2020-02-02 17:58:15 +01:00
|
|
|
| | another mutable borrow, by `b`, occurs here
|
|
|
|
| first mutable borrow, by `a`, occurs here
|
2019-12-15 00:32:20 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:11:11
|
2019-12-15 03:50:55 +01:00
|
|
|
|
|
|
|
|
LL | fn f1(ref mut a @ ref mut b: U) {}
|
|
|
|
| ---------^^^---------
|
|
|
|
| | |
|
2020-02-02 17:58:15 +01:00
|
|
|
| | another mutable borrow, by `b`, occurs here
|
|
|
|
| first mutable borrow, by `a`, occurs here
|
2019-12-15 03:50:55 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:13:11
|
2019-12-15 03:50:55 +01:00
|
|
|
|
|
|
|
|
LL | fn f2(ref mut a @ ref mut b: U) {}
|
|
|
|
| ---------^^^---------
|
|
|
|
| | |
|
2020-02-02 17:58:15 +01:00
|
|
|
| | another mutable borrow, by `b`, occurs here
|
|
|
|
| first mutable borrow, by `a`, occurs here
|
2019-12-15 03:50:55 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:16:9
|
2019-12-15 03:50:55 +01:00
|
|
|
|
|
|
|
|
LL | ref mut a @ [
|
|
|
|
| ^--------
|
|
|
|
| |
|
2020-02-02 17:58:15 +01:00
|
|
|
| _________first mutable borrow, by `a`, occurs here
|
2019-12-15 03:50:55 +01:00
|
|
|
| |
|
|
|
|
LL | |
|
|
|
|
LL | | [ref b @ .., _],
|
2020-02-02 17:58:15 +01:00
|
|
|
| | ---------- also borrowed as immutable, by `b`, here
|
2019-12-15 03:50:55 +01:00
|
|
|
LL | | [_, ref mut mid @ ..],
|
2020-02-02 17:58:15 +01:00
|
|
|
| | ---------------- another mutable borrow, by `mid`, occurs here
|
2019-12-15 03:50:55 +01:00
|
|
|
LL | | ..,
|
|
|
|
LL | | [..],
|
|
|
|
LL | | ] : [[U; 4]; 5]
|
|
|
|
| |_________^
|
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:24:22
|
|
|
|
|
|
|
|
|
LL | fn f4_also_moved(ref mut a @ ref mut b @ c: U) {}
|
|
|
|
| ---------^^^-------------
|
|
|
|
| | | |
|
2020-02-02 17:58:15 +01:00
|
|
|
| | | also moved into `c` here
|
|
|
|
| | another mutable borrow, by `b`, occurs here
|
|
|
|
| first mutable borrow, by `a`, occurs here
|
2020-01-19 02:47:01 +01:00
|
|
|
|
2020-02-02 17:58:15 +01:00
|
|
|
error: cannot move out of value because it is borrowed
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:24:34
|
|
|
|
|
|
|
|
|
LL | fn f4_also_moved(ref mut a @ ref mut b @ c: U) {}
|
|
|
|
| ---------^^^-
|
|
|
|
| | |
|
2020-02-02 17:58:15 +01:00
|
|
|
| | value moved into `c` here
|
|
|
|
| value borrowed, by `b`, here
|
2020-01-19 02:47:01 +01:00
|
|
|
|
2020-03-25 11:17:06 +01:00
|
|
|
error[E0499]: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:28:21
|
2019-11-11 11:39:52 +01:00
|
|
|
|
|
|
|
|
LL | let ref mut a @ ref mut b = U;
|
|
|
|
| ------------^^^^^^^^^
|
|
|
|
| | |
|
|
|
|
| | second mutable borrow occurs here
|
|
|
|
| first mutable borrow occurs here
|
2019-12-15 00:32:20 +01:00
|
|
|
...
|
2019-11-11 11:39:52 +01:00
|
|
|
LL | drop(a);
|
|
|
|
| - first borrow later used here
|
|
|
|
|
2020-03-25 11:17:06 +01:00
|
|
|
error[E0499]: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:38:21
|
2019-11-11 11:39:52 +01:00
|
|
|
|
|
|
|
|
LL | let ref mut a @ ref mut b = U;
|
|
|
|
| ------------^^^^^^^^^
|
|
|
|
| | |
|
|
|
|
| | second mutable borrow occurs here
|
|
|
|
| first mutable borrow occurs here
|
2019-12-15 00:32:20 +01:00
|
|
|
...
|
2019-11-11 11:39:52 +01:00
|
|
|
LL | *a = U;
|
|
|
|
| ------ first borrow later used here
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:66:25
|
2019-11-11 11:39:52 +01:00
|
|
|
|
|
|
|
|
LL | let a @ (ref mut b, ref mut c) = (U, U);
|
|
|
|
| ----------------^^^^^^^^^- ------ move occurs because value has type `(main::U, main::U)`, which does not implement the `Copy` trait
|
|
|
|
| | |
|
|
|
|
| | value borrowed here after move
|
|
|
|
| value moved here
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:70:21
|
2019-11-11 11:39:52 +01:00
|
|
|
|
|
|
|
|
LL | let a @ (b, [c, d]) = &mut val; // Same as ^--
|
|
|
|
| ------------^-- -------- move occurs because value has type `&mut (main::U, [main::U; 2])`, which does not implement the `Copy` trait
|
|
|
|
| | |
|
|
|
|
| | value borrowed here after move
|
|
|
|
| value moved here
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:74:18
|
2019-11-11 11:39:52 +01:00
|
|
|
|
|
|
|
|
LL | let a @ &mut ref mut b = &mut U;
|
|
|
|
| ---------^^^^^^^^^ ------ move occurs because value has type `&mut main::U`, which does not implement the `Copy` trait
|
|
|
|
| | |
|
|
|
|
| | value borrowed here after move
|
|
|
|
| value moved here
|
|
|
|
|
|
|
|
error[E0382]: borrow of moved value
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:77:30
|
2019-11-11 11:39:52 +01:00
|
|
|
|
|
|
|
|
LL | let a @ &mut (ref mut b, ref mut c) = &mut (U, U);
|
|
|
|
| ---------------------^^^^^^^^^- ----------- move occurs because value has type `&mut (main::U, main::U)`, which does not implement the `Copy` trait
|
|
|
|
| | |
|
|
|
|
| | value borrowed here after move
|
|
|
|
| value moved here
|
|
|
|
|
2020-03-25 11:17:06 +01:00
|
|
|
error[E0499]: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:95:24
|
2019-11-11 11:39:52 +01:00
|
|
|
|
|
|
|
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
|
|
|
|
| ---------------^^^^^^^^^-
|
|
|
|
| | |
|
|
|
|
| | second mutable borrow occurs here
|
|
|
|
| first mutable borrow occurs here
|
|
|
|
...
|
|
|
|
LL | *a = Err(U);
|
|
|
|
| ----------- first borrow later used here
|
|
|
|
|
2020-03-25 11:17:06 +01:00
|
|
|
error[E0499]: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:95:53
|
2019-11-11 11:39:52 +01:00
|
|
|
|
|
|
|
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
|
|
|
|
| ----------------^^^^^^^^^-
|
|
|
|
| | |
|
|
|
|
| | second mutable borrow occurs here
|
|
|
|
| first mutable borrow occurs here
|
|
|
|
...
|
|
|
|
LL | *a = Err(U);
|
|
|
|
| ----------- first borrow later used here
|
|
|
|
|
2020-03-25 11:17:06 +01:00
|
|
|
error[E0499]: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:107:24
|
2019-11-11 11:39:52 +01:00
|
|
|
|
|
|
|
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
|
|
|
|
| ---------------^^^^^^^^^-
|
|
|
|
| | |
|
|
|
|
| | second mutable borrow occurs here
|
|
|
|
| first mutable borrow occurs here
|
|
|
|
...
|
|
|
|
LL | drop(a);
|
|
|
|
| - first borrow later used here
|
|
|
|
|
2020-03-25 11:17:06 +01:00
|
|
|
error[E0499]: cannot borrow value as mutable more than once at a time
|
2020-01-19 02:47:01 +01:00
|
|
|
--> $DIR/borrowck-pat-ref-mut-twice.rs:107:53
|
2019-11-11 11:39:52 +01:00
|
|
|
|
|
|
|
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
|
|
|
|
| ----------------^^^^^^^^^-
|
|
|
|
| | |
|
|
|
|
| | second mutable borrow occurs here
|
|
|
|
| first mutable borrow occurs here
|
|
|
|
...
|
|
|
|
LL | drop(a);
|
|
|
|
| - first borrow later used here
|
|
|
|
|
2020-01-19 02:47:01 +01:00
|
|
|
error: aborting due to 34 previous errors
|
2019-11-11 11:39:52 +01:00
|
|
|
|
2020-01-19 02:47:01 +01:00
|
|
|
Some errors have detailed explanations: E0382, E0499.
|
|
|
|
For more information about an error, try `rustc --explain E0382`.
|