1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
|
error[E0382]: borrow of moved value: `x.0.0`
--> $DIR/or-patterns.rs:8:5
|
LL | ((y, _) | (_, y),) => (),
| - value moved here
LL | }
LL | &x.0 .0;
| ^^^^^^^ value borrowed here after move
|
= note: move occurs because `x.0.0` has type `String`, which does not implement the `Copy` trait
help: borrow this binding in the pattern to avoid moving the value
|
LL | ((ref y, _) | (_, y),) => (),
| +++
error[E0382]: borrow of moved value: `x.0.1`
--> $DIR/or-patterns.rs:10:5
|
LL | ((y, _) | (_, y),) => (),
| - value moved here
...
LL | &x.0 .1;
| ^^^^^^^ value borrowed here after move
|
= note: move occurs because `x.0.1` has type `String`, which does not implement the `Copy` trait
help: borrow this binding in the pattern to avoid moving the value
|
LL | ((y, _) | (_, ref y),) => (),
| +++
error[E0502]: cannot borrow `x.0.0` as mutable because it is also borrowed as immutable
--> $DIR/or-patterns.rs:18:5
|
LL | ((ref y, _) | (_, ref y),) => y,
| ----- immutable borrow occurs here
LL | };
LL | &mut x.0 .0;
| ^^^^^^^^^^^ mutable borrow occurs here
...
LL | drop(r);
| - immutable borrow later used here
error[E0502]: cannot borrow `x.0.1` as mutable because it is also borrowed as immutable
--> $DIR/or-patterns.rs:20:5
|
LL | ((ref y, _) | (_, ref y),) => y,
| ----- immutable borrow occurs here
...
LL | &mut x.0 .1;
| ^^^^^^^^^^^ mutable borrow occurs here
LL |
LL | drop(r);
| - immutable borrow later used here
error[E0502]: cannot borrow `x.0.0` as immutable because it is also borrowed as mutable
--> $DIR/or-patterns.rs:29:5
|
LL | ((ref mut y, _) | (_, ref mut y),) => y,
| --------- mutable borrow occurs here
LL | };
LL | &x.0 .0;
| ^^^^^^^ immutable borrow occurs here
...
LL | drop(r);
| - mutable borrow later used here
error[E0502]: cannot borrow `x.0.1` as immutable because it is also borrowed as mutable
--> $DIR/or-patterns.rs:31:5
|
LL | ((ref mut y, _) | (_, ref mut y),) => y,
| --------- mutable borrow occurs here
...
LL | &x.0 .1;
| ^^^^^^^ immutable borrow occurs here
LL |
LL | drop(r);
| - mutable borrow later used here
error[E0382]: borrow of moved value: `x.0.0`
--> $DIR/or-patterns.rs:38:5
|
LL | let ((y, _) | (_, y),) = x;
| - value moved here
LL | &x.0 .0;
| ^^^^^^^ value borrowed here after move
|
= note: move occurs because `x.0.0` has type `String`, which does not implement the `Copy` trait
help: borrow this binding in the pattern to avoid moving the value
|
LL | let ((ref y, _) | (_, y),) = x;
| +++
error[E0382]: borrow of moved value: `x.0.1`
--> $DIR/or-patterns.rs:40:5
|
LL | let ((y, _) | (_, y),) = x;
| - value moved here
...
LL | &x.0 .1;
| ^^^^^^^ value borrowed here after move
|
= note: move occurs because `x.0.1` has type `String`, which does not implement the `Copy` trait
help: borrow this binding in the pattern to avoid moving the value
|
LL | let ((y, _) | (_, ref y),) = x;
| +++
error[E0502]: cannot borrow `x.0.0` as mutable because it is also borrowed as immutable
--> $DIR/or-patterns.rs:46:5
|
LL | let ((ref r, _) | (_, ref r),) = x;
| ----- immutable borrow occurs here
LL | &mut x.0 .0;
| ^^^^^^^^^^^ mutable borrow occurs here
...
LL | drop(r);
| - immutable borrow later used here
error[E0502]: cannot borrow `x.0.1` as mutable because it is also borrowed as immutable
--> $DIR/or-patterns.rs:48:5
|
LL | let ((ref r, _) | (_, ref r),) = x;
| ----- immutable borrow occurs here
...
LL | &mut x.0 .1;
| ^^^^^^^^^^^ mutable borrow occurs here
LL |
LL | drop(r);
| - immutable borrow later used here
error[E0502]: cannot borrow `x.0.0` as immutable because it is also borrowed as mutable
--> $DIR/or-patterns.rs:55:5
|
LL | let ((ref mut r, _) | (_, ref mut r),) = x;
| --------- mutable borrow occurs here
LL | &x.0 .0;
| ^^^^^^^ immutable borrow occurs here
...
LL | drop(r);
| - mutable borrow later used here
error[E0502]: cannot borrow `x.0.1` as immutable because it is also borrowed as mutable
--> $DIR/or-patterns.rs:57:5
|
LL | let ((ref mut r, _) | (_, ref mut r),) = x;
| --------- mutable borrow occurs here
...
LL | &x.0 .1;
| ^^^^^^^ immutable borrow occurs here
LL |
LL | drop(r);
| - mutable borrow later used here
error: aborting due to 12 previous errors
Some errors have detailed explanations: E0382, E0502.
For more information about an error, try `rustc --explain E0382`.
|