1
1
error[E0382]: use of moved value: `t`
2
- --> $DIR/use_of_moved_value_copy_suggestions.rs:2 :9
2
+ --> $DIR/use_of_moved_value_copy_suggestions.rs:6 :9
3
3
|
4
4
LL | fn duplicate_t<T>(t: T) -> (T, T) {
5
5
| - move occurs because `t` has type `T`, which does not implement the `Copy` trait
6
+ LL |
6
7
LL | (t, t)
7
8
| - ^ value used here after move
8
9
| |
@@ -14,10 +15,11 @@ LL | fn duplicate_t<T: Copy>(t: T) -> (T, T) {
14
15
| ++++++
15
16
16
17
error[E0382]: use of moved value: `t`
17
- --> $DIR/use_of_moved_value_copy_suggestions.rs:6 :9
18
+ --> $DIR/use_of_moved_value_copy_suggestions.rs:11 :9
18
19
|
19
20
LL | fn duplicate_opt<T>(t: Option<T>) -> (Option<T>, Option<T>) {
20
21
| - move occurs because `t` has type `Option<T>`, which does not implement the `Copy` trait
22
+ LL |
21
23
LL | (t, t)
22
24
| - ^ value used here after move
23
25
| |
@@ -29,10 +31,11 @@ LL | fn duplicate_opt<T: Copy>(t: Option<T>) -> (Option<T>, Option<T>) {
29
31
| ++++++
30
32
31
33
error[E0382]: use of moved value: `t`
32
- --> $DIR/use_of_moved_value_copy_suggestions.rs:10 :9
34
+ --> $DIR/use_of_moved_value_copy_suggestions.rs:16 :9
33
35
|
34
36
LL | fn duplicate_tup1<T>(t: (T,)) -> ((T,), (T,)) {
35
37
| - move occurs because `t` has type `(T,)`, which does not implement the `Copy` trait
38
+ LL |
36
39
LL | (t, t)
37
40
| - ^ value used here after move
38
41
| |
@@ -44,10 +47,11 @@ LL | fn duplicate_tup1<T: Copy>(t: (T,)) -> ((T,), (T,)) {
44
47
| ++++++
45
48
46
49
error[E0382]: use of moved value: `t`
47
- --> $DIR/use_of_moved_value_copy_suggestions.rs:14 :9
50
+ --> $DIR/use_of_moved_value_copy_suggestions.rs:21 :9
48
51
|
49
52
LL | fn duplicate_tup2<A, B>(t: (A, B)) -> ((A, B), (A, B)) {
50
53
| - move occurs because `t` has type `(A, B)`, which does not implement the `Copy` trait
54
+ LL |
51
55
LL | (t, t)
52
56
| - ^ value used here after move
53
57
| |
@@ -59,10 +63,11 @@ LL | fn duplicate_tup2<A: Copy, B: Copy>(t: (A, B)) -> ((A, B), (A, B)) {
59
63
| ++++++ ++++++
60
64
61
65
error[E0382]: use of moved value: `t`
62
- --> $DIR/use_of_moved_value_copy_suggestions.rs:18 :9
66
+ --> $DIR/use_of_moved_value_copy_suggestions.rs:26 :9
63
67
|
64
68
LL | fn duplicate_custom<T>(t: S<T>) -> (S<T>, S<T>) {
65
69
| - move occurs because `t` has type `S<T>`, which does not implement the `Copy` trait
70
+ LL |
66
71
LL | (t, t)
67
72
| - ^ value used here after move
68
73
| |
@@ -74,10 +79,11 @@ LL | fn duplicate_custom<T: Trait + Copy>(t: S<T>) -> (S<T>, S<T>) {
74
79
| ++++++++++++++
75
80
76
81
error[E0382]: use of moved value: `t`
77
- --> $DIR/use_of_moved_value_copy_suggestions.rs:35 :9
82
+ --> $DIR/use_of_moved_value_copy_suggestions.rs:44 :9
78
83
|
79
84
LL | fn duplicate_custom_1<T>(t: S<T>) -> (S<T>, S<T>) where {
80
85
| - move occurs because `t` has type `S<T>`, which does not implement the `Copy` trait
86
+ LL |
81
87
LL | (t, t)
82
88
| - ^ value used here after move
83
89
| |
@@ -89,7 +95,7 @@ LL | fn duplicate_custom_1<T: Trait + Copy>(t: S<T>) -> (S<T>, S<T>) where {
89
95
| ++++++++++++++
90
96
91
97
error[E0382]: use of moved value: `t`
92
- --> $DIR/use_of_moved_value_copy_suggestions.rs:42 :9
98
+ --> $DIR/use_of_moved_value_copy_suggestions.rs:52 :9
93
99
|
94
100
LL | fn duplicate_custom_2<T>(t: S<T>) -> (S<T>, S<T>)
95
101
| - move occurs because `t` has type `S<T>`, which does not implement the `Copy` trait
@@ -105,7 +111,7 @@ LL | T: A + Trait + Copy,
105
111
| ++++++++++++++
106
112
107
113
error[E0382]: use of moved value: `t`
108
- --> $DIR/use_of_moved_value_copy_suggestions.rs:50 :9
114
+ --> $DIR/use_of_moved_value_copy_suggestions.rs:61 :9
109
115
|
110
116
LL | fn duplicate_custom_3<T>(t: S<T>) -> (S<T>, S<T>)
111
117
| - move occurs because `t` has type `S<T>`, which does not implement the `Copy` trait
@@ -121,7 +127,7 @@ LL | T: B, T: Trait, T: Copy
121
127
| ~~~~~~~~~~~~~~~~~~~
122
128
123
129
error[E0382]: use of moved value: `t`
124
- --> $DIR/use_of_moved_value_copy_suggestions.rs:57 :9
130
+ --> $DIR/use_of_moved_value_copy_suggestions.rs:69 :9
125
131
|
126
132
LL | fn duplicate_custom_4<T: A>(t: S<T>) -> (S<T>, S<T>)
127
133
| - move occurs because `t` has type `S<T>`, which does not implement the `Copy` trait
@@ -136,16 +142,6 @@ help: consider further restricting this bound
136
142
LL | T: B + Trait + Copy,
137
143
| ++++++++++++++
138
144
139
- error[E0382]: use of moved value: `t`
140
- --> $DIR/use_of_moved_value_copy_suggestions.rs:62:9
141
- |
142
- LL | fn duplicate_rc<T>(t: std::rc::Rc<T>) -> (std::rc::Rc<T>, std::rc::Rc<T>) {
143
- | - move occurs because `t` has type `Rc<T>`, which does not implement the `Copy` trait
144
- LL | (t, t)
145
- | - ^ value used here after move
146
- | |
147
- | value moved here
148
-
149
- error: aborting due to 10 previous errors
145
+ error: aborting due to 9 previous errors
150
146
151
147
For more information about this error, try `rustc --explain E0382`.
0 commit comments