fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

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