File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
src/librustc_mir/transform Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,20 @@ impl MirPass for ElaborateDrops {
4141
4242 let id = tcx. hir . as_local_node_id ( src. def_id ) . unwrap ( ) ;
4343 let param_env = tcx. param_env ( src. def_id ) . with_reveal_all ( ) ;
44- let move_data = MoveData :: gather_moves ( mir, tcx) . unwrap ( ) ;
44+ let move_data = match MoveData :: gather_moves ( mir, tcx) {
45+ Ok ( move_data) => move_data,
46+ Err ( ( move_data, _move_errors) ) => {
47+ // The only way we should be allowing any move_errors
48+ // in here is if we are in the migration path for the
49+ // NLL-based MIR-borrowck.
50+ //
51+ // If we are in the migration path, we have already
52+ // reported these errors as warnings to the user. So
53+ // we will just ignore them here.
54+ assert ! ( tcx. migrate_borrowck( ) ) ;
55+ move_data
56+ }
57+ } ;
4558 let elaborate_patch = {
4659 let mir = & * mir;
4760 let env = MoveDataParamEnv {
You can’t perform that action at this time.
0 commit comments