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