|
8 | 8 | // option. This file may not be copied, modified, or distributed
|
9 | 9 | // except according to those terms.
|
10 | 10 |
|
11 |
| -use syntax_pos::DUMMY_SP; |
12 |
| - |
13 | 11 | use rustc::mir::{self, Mir, Location};
|
14 | 12 | use rustc::ty::{self, TyCtxt};
|
15 | 13 | use util::elaborate_drops::DropFlagState;
|
@@ -187,23 +185,13 @@ pub(crate) fn drop_flag_effects_for_location<'a, 'gcx, 'tcx, F>(
|
187 | 185 | where F: FnMut(MovePathIndex, DropFlagState)
|
188 | 186 | {
|
189 | 187 | let move_data = &ctxt.move_data;
|
190 |
| - let param_env = ctxt.param_env; |
191 | 188 | debug!("drop_flag_effects_for_location({:?})", loc);
|
192 | 189 |
|
193 | 190 | // first, move out of the RHS
|
194 | 191 | for mi in &move_data.loc_map[loc] {
|
195 | 192 | let path = mi.move_path_index(move_data);
|
196 | 193 | debug!("moving out of path {:?}", move_data.move_paths[path]);
|
197 | 194 |
|
198 |
| - // don't move out of non-Copy things |
199 |
| - let lvalue = &move_data.move_paths[path].lvalue; |
200 |
| - let ty = lvalue.ty(mir, tcx).to_ty(tcx); |
201 |
| - let gcx = tcx.global_tcx(); |
202 |
| - let erased_ty = gcx.lift(&tcx.erase_regions(&ty)).unwrap(); |
203 |
| - if !erased_ty.moves_by_default(gcx, param_env, DUMMY_SP) { |
204 |
| - continue; |
205 |
| - } |
206 |
| - |
207 | 195 | on_all_children_bits(tcx, mir, move_data,
|
208 | 196 | path,
|
209 | 197 | |mpi| callback(mpi, DropFlagState::Absent))
|
@@ -231,13 +219,8 @@ pub(crate) fn drop_flag_effects_for_location<'a, 'gcx, 'tcx, F>(
|
231 | 219 | }
|
232 | 220 | }
|
233 | 221 | }
|
234 |
| - mir::StatementKind::StorageDead(local) => { |
235 |
| - on_lookup_result_bits(tcx, mir, move_data, |
236 |
| - move_data.rev_lookup.find(&mir::Lvalue::Local(local)), |
237 |
| - |mpi| callback(mpi, DropFlagState::Absent)) |
238 |
| - |
239 |
| - } |
240 | 222 | mir::StatementKind::StorageLive(_) |
|
| 223 | + mir::StatementKind::StorageDead(_) | |
241 | 224 | mir::StatementKind::InlineAsm { .. } |
|
242 | 225 | mir::StatementKind::EndRegion(_) |
|
243 | 226 | mir::StatementKind::Validate(..) |
|
|
0 commit comments