diff options
| author | Gary Guo <gary@garyguo.net> | 2023-03-06 16:36:42 +0000 |
|---|---|---|
| committer | Gary Guo <gary@garyguo.net> | 2023-04-06 09:34:16 +0100 |
| commit | c5829c2ee544eb9931ce0d34f46b113b0a1e7f04 (patch) | |
| tree | 462612abbcf6fc85b3a0b96eabcf5a86079941dc | |
| parent | e29b5badbcf1d2f5e16bca00d067e07c18770f12 (diff) | |
| download | rust-c5829c2ee544eb9931ce0d34f46b113b0a1e7f04.tar.gz rust-c5829c2ee544eb9931ce0d34f46b113b0a1e7f04.zip | |
Fix new usage of old api
| -rw-r--r-- | compiler/rustc_mir_build/src/build/custom/parse/instruction.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_mir_build/src/build/scope.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_mir_transform/src/elaborate_drops.rs | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_mir_build/src/build/custom/parse/instruction.rs b/compiler/rustc_mir_build/src/build/custom/parse/instruction.rs index 33b73928704..54028dfe87b 100644 --- a/compiler/rustc_mir_build/src/build/custom/parse/instruction.rs +++ b/compiler/rustc_mir_build/src/build/custom/parse/instruction.rs @@ -56,7 +56,7 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> { Ok(TerminatorKind::Drop { place: self.parse_place(args[0])?, target: self.parse_block(args[1])?, - unwind: None, + unwind: UnwindAction::Continue, }) }, @call("mir_call", args) => { @@ -126,7 +126,7 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> { args, destination, target: Some(target), - cleanup: None, + unwind: UnwindAction::Continue, from_hir_call: *from_hir_call, fn_span: *fn_span, }) diff --git a/compiler/rustc_mir_build/src/build/scope.rs b/compiler/rustc_mir_build/src/build/scope.rs index 2c401405f92..f32d2db4e71 100644 --- a/compiler/rustc_mir_build/src/build/scope.rs +++ b/compiler/rustc_mir_build/src/build/scope.rs @@ -1438,11 +1438,11 @@ impl<'tcx> DropTreeBuilder<'tcx> for Unwind { let term = &mut cfg.block_data_mut(from).terminator_mut(); match &mut term.kind { TerminatorKind::Drop { unwind, .. } => { - if let Some(unwind) = *unwind { + if let UnwindAction::Cleanup(unwind) = *unwind { let source_info = term.source_info; cfg.terminate(unwind, source_info, TerminatorKind::Goto { target: to }); } else { - *unwind = Some(to); + *unwind = UnwindAction::Cleanup(to); } } TerminatorKind::FalseUnwind { unwind, .. } diff --git a/compiler/rustc_mir_transform/src/elaborate_drops.rs b/compiler/rustc_mir_transform/src/elaborate_drops.rs index dd7fd2524e0..a702113bd99 100644 --- a/compiler/rustc_mir_transform/src/elaborate_drops.rs +++ b/compiler/rustc_mir_transform/src/elaborate_drops.rs @@ -160,7 +160,7 @@ fn remove_dead_unwinds<'tcx>( let basic_blocks = body.basic_blocks.as_mut(); for &bb in dead_unwinds.iter() { if let Some(unwind) = basic_blocks[bb].terminator_mut().unwind_mut() { - *unwind = None; + *unwind = UnwindAction::Unreachable; } } } |
