@@ -142,22 +142,6 @@ fn need_shared_lhs_rhs(tcx: ty::ctxt, a: @ast::expr, b: @ast::expr, op: str) {
142
142
need_expr_kind ( tcx, b, ast:: kind_shared, op + " rhs" ) ;
143
143
}
144
144
145
- // Additional checks for copyability that require a little more nuance
146
- fn check_copy ( tcx : ty:: ctxt , e : @ast:: expr ) {
147
- alt ty:: struct ( tcx, ty:: expr_ty ( tcx, e) ) {
148
- // Unique boxes most not contain pinned kinds
149
- ty:: ty_uniq ( mt) {
150
- demand_kind ( tcx, e. span , mt. ty , ast:: kind_shared,
151
- "unique box interior" ) ;
152
- }
153
- ty:: ty_vec ( mt) {
154
- demand_kind ( tcx, e. span , mt. ty , ast:: kind_shared,
155
- "vector interior" ) ;
156
- }
157
- _ { }
158
- }
159
- }
160
-
161
145
fn check_expr ( tcx : ty:: ctxt , e : @ast:: expr ) {
162
146
alt e. node {
163
147
@@ -168,16 +152,13 @@ fn check_expr(tcx: ty::ctxt, e: @ast::expr) {
168
152
ast:: expr_move ( a, b) { need_shared_lhs_rhs ( tcx, a, b, "<-" ) ; }
169
153
ast:: expr_assign ( a, b) {
170
154
need_shared_lhs_rhs ( tcx, a, b, "=" ) ;
171
- check_copy ( tcx, b) ;
172
155
}
173
156
ast:: expr_assign_op ( _, a, b) {
174
157
need_shared_lhs_rhs ( tcx, a, b, "op=" ) ;
175
- check_copy ( tcx, b) ;
176
158
}
177
159
ast:: expr_swap ( a, b) { need_shared_lhs_rhs ( tcx, a, b, "<->" ) ; }
178
160
ast:: expr_copy ( a) {
179
161
need_expr_kind ( tcx, a, ast:: kind_shared, "'copy' operand" ) ;
180
- check_copy ( tcx, a) ;
181
162
}
182
163
ast:: expr_ret ( option:: some ( a) ) {
183
164
need_expr_kind ( tcx, a, ast:: kind_shared, "'ret' operand" ) ;
@@ -221,9 +202,11 @@ fn check_stmt(tcx: ty::ctxt, stmt: @ast::stmt) {
221
202
need_expr_kind ( tcx, expr,
222
203
ast:: kind_shared,
223
204
"local initializer" ) ;
224
- check_copy ( tcx, expr) ;
225
205
}
226
- _ { /* fall through */ }
206
+ option:: some ( { op: ast:: init_move. , expr} ) {
207
+ // FIXME: Same as above
208
+ }
209
+ option:: none. { /* fall through */ }
227
210
}
228
211
}
229
212
}
0 commit comments