diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2018-07-25 01:31:40 +0200 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2018-07-26 13:17:55 +0200 |
| commit | 346011515760dd552bd41d4abf8a2a55471a9e84 (patch) | |
| tree | 26f847a1cd0081139160c5b019b2d5cff9eda8f2 | |
| parent | ff2f9e02345cac102510870a67bef51e0c409a4f (diff) | |
| download | rust-346011515760dd552bd41d4abf8a2a55471a9e84.tar.gz rust-346011515760dd552bd41d4abf8a2a55471a9e84.zip | |
Allow elaborate_drops to progress under errors that come up during borrowck=migrate.
| -rw-r--r-- | src/librustc_mir/transform/elaborate_drops.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/librustc_mir/transform/elaborate_drops.rs b/src/librustc_mir/transform/elaborate_drops.rs index d35608068a6..937d01a0c5e 100644 --- a/src/librustc_mir/transform/elaborate_drops.rs +++ b/src/librustc_mir/transform/elaborate_drops.rs @@ -41,7 +41,20 @@ impl MirPass for ElaborateDrops { let id = tcx.hir.as_local_node_id(src.def_id).unwrap(); let param_env = tcx.param_env(src.def_id).with_reveal_all(); - let move_data = MoveData::gather_moves(mir, tcx).unwrap(); + let move_data = match MoveData::gather_moves(mir, tcx) { + Ok(move_data) => move_data, + Err((move_data, _move_errors)) => { + // The only way we should be allowing any move_errors + // in here is if we are in the migration path for the + // NLL-based MIR-borrowck. + // + // If we are in the migration path, we have already + // reported these errors as warnings to the user. So + // we will just ignore them here. + assert!(tcx.migrate_borrowck()); + move_data + } + }; let elaborate_patch = { let mir = &*mir; let env = MoveDataParamEnv { |
