fork/rust

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

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
4.8 KiB133 linesraw
1error[E0007]: cannot bind by-move with sub-bindings
2  --> $DIR/borrowck-move-and-move.rs:11:9
3   |
4LL |     let a @ b = U;
5   |         ^^^^^ binds an already bound by-move value by moving it
6
7error[E0007]: cannot bind by-move with sub-bindings
8  --> $DIR/borrowck-move-and-move.rs:15:9
9   |
10LL |     let a @ (b, c) = (U, U);
11   |         ^^^^^^^^^^ binds an already bound by-move value by moving it
12
13error[E0007]: cannot bind by-move with sub-bindings
14  --> $DIR/borrowck-move-and-move.rs:19:9
15   |
16LL |     let a @ (b, c) = (u(), u());
17   |         ^^^^^^^^^^ binds an already bound by-move value by moving it
18
19error[E0007]: cannot bind by-move with sub-bindings
20  --> $DIR/borrowck-move-and-move.rs:24:9
21   |
22LL |         a @ Ok(b) | a @ Err(b) => {}
23   |         ^^^^^^^^^ binds an already bound by-move value by moving it
24
25error[E0007]: cannot bind by-move with sub-bindings
26  --> $DIR/borrowck-move-and-move.rs:24:21
27   |
28LL |         a @ Ok(b) | a @ Err(b) => {}
29   |                     ^^^^^^^^^^ binds an already bound by-move value by moving it
30
31error[E0007]: cannot bind by-move with sub-bindings
32  --> $DIR/borrowck-move-and-move.rs:36:9
33   |
34LL |         xs @ [a, .., b] => {}
35   |         ^^^^^^^^^^^^^^^ binds an already bound by-move value by moving it
36
37error[E0007]: cannot bind by-move with sub-bindings
38  --> $DIR/borrowck-move-and-move.rs:42:9
39   |
40LL |         xs @ [_, ys @ .., _] => {}
41   |         ^^^^^^^^^^^^^^^^^^^^ binds an already bound by-move value by moving it
42
43error[E0007]: cannot bind by-move with sub-bindings
44  --> $DIR/borrowck-move-and-move.rs:31:12
45   |
46LL |     fn fun(a @ b: U) {}
47   |            ^^^^^ binds an already bound by-move value by moving it
48
49error[E0382]: use of moved value
50  --> $DIR/borrowck-move-and-move.rs:11:13
51   |
52LL |     let a @ b = U;
53   |         ----^   - move occurs because value has type `main::U`, which does not implement the `Copy` trait
54   |         |   |
55   |         |   value used here after move
56   |         value moved here
57
58error[E0382]: use of moved value
59  --> $DIR/borrowck-move-and-move.rs:15:17
60   |
61LL |     let a @ (b, c) = (U, U);
62   |         --------^-   ------ move occurs because value has type `(main::U, main::U)`, which does not implement the `Copy` trait
63   |         |       |
64   |         |       value used here after move
65   |         value moved here
66
67error[E0382]: use of moved value
68  --> $DIR/borrowck-move-and-move.rs:19:17
69   |
70LL |     let a @ (b, c) = (u(), u());
71   |         --------^-   ---------- move occurs because value has type `(main::U, main::U)`, which does not implement the `Copy` trait
72   |         |       |
73   |         |       value used here after move
74   |         value moved here
75
76error[E0382]: use of moved value
77  --> $DIR/borrowck-move-and-move.rs:24:16
78   |
79LL |     match Ok(U) {
80   |           ----- move occurs because value has type `std::result::Result<main::U, main::U>`, which does not implement the `Copy` trait
81LL |         a @ Ok(b) | a @ Err(b) => {}
82   |         -------^-
83   |         |      |
84   |         |      value used here after move
85   |         value moved here
86
87error[E0382]: use of moved value
88  --> $DIR/borrowck-move-and-move.rs:24:29
89   |
90LL |     match Ok(U) {
91   |           ----- move occurs because value has type `std::result::Result<main::U, main::U>`, which does not implement the `Copy` trait
92LL |         a @ Ok(b) | a @ Err(b) => {}
93   |                     --------^-
94   |                     |       |
95   |                     |       value used here after move
96   |                     value moved here
97
98error[E0382]: use of moved value
99  --> $DIR/borrowck-move-and-move.rs:36:22
100   |
101LL |     match [u(), u(), u(), u()] {
102   |           -------------------- move occurs because value has type `[main::U; 4]`, which does not implement the `Copy` trait
103LL |         xs @ [a, .., b] => {}
104   |         -------------^-
105   |         |            |
106   |         |            value used here after move
107   |         value moved here
108
109error[E0382]: use of moved value
110  --> $DIR/borrowck-move-and-move.rs:42:18
111   |
112LL |     match [u(), u(), u(), u()] {
113   |           -------------------- move occurs because value has type `[main::U; 4]`, which does not implement the `Copy` trait
114LL |         xs @ [_, ys @ .., _] => {}
115   |         ---------^^^^^^^----
116   |         |        |
117   |         |        value used here after move
118   |         value moved here
119
120error[E0382]: use of moved value
121  --> $DIR/borrowck-move-and-move.rs:31:16
122   |
123LL |     fn fun(a @ b: U) {}
124   |            ----^
125   |            |   |
126   |            |   value used here after move
127   |            value moved here
128   |            move occurs because value has type `main::U`, which does not implement the `Copy` trait
129
130error: aborting due to 16 previous errors
131
132Some errors have detailed explanations: E0007, E0382.
133For more information about an error, try `rustc --explain E0007`.