diff options
| author | bors <bors@rust-lang.org> | 2023-06-15 22:54:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-06-15 22:54:43 +0000 |
| commit | 0252b4093ff19a8aaae2a1965b76b9ba4528e5c0 (patch) | |
| tree | bbd28a869da0e03dd01081a0ea0b87e3e0af9ed7 /compiler/rustc_mir_transform/src | |
| parent | 114fb86ca08cfa6a99087e0f0bc264d03590dc37 (diff) | |
| parent | 05d5449522a4318b740c8acae2f19cc064ba48a8 (diff) | |
| download | rust-0252b4093ff19a8aaae2a1965b76b9ba4528e5c0.tar.gz rust-0252b4093ff19a8aaae2a1965b76b9ba4528e5c0.zip | |
Auto merge of #112681 - GuillaumeGomez:rollup-rwn4086, r=GuillaumeGomez
Rollup of 8 pull requests Successful merges: - #112403 (Prevent `.eh_frame` from being emitted for `-C panic=abort`) - #112517 (`suspicious_double_ref_op`: don't lint on `.borrow()`) - #112529 (Extend `unused_must_use` to cover block exprs) - #112614 (tweak suggestion for argument-position `impl ?Sized`) - #112654 (normalize closure output in equate_inputs_and_outputs) - #112660 (Migrate GUI colors test to original CSS color format) - #112664 (Add support for test tmpdir to fuchsia test runner) - #112669 (Fix comment for ptr alignment checks in codegen) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_mir_transform/src')
| -rw-r--r-- | compiler/rustc_mir_transform/src/check_alignment.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/rustc_mir_transform/src/check_alignment.rs b/compiler/rustc_mir_transform/src/check_alignment.rs index 1fe8ea07892..ef64f70fdf3 100644 --- a/compiler/rustc_mir_transform/src/check_alignment.rs +++ b/compiler/rustc_mir_transform/src/check_alignment.rs @@ -9,6 +9,7 @@ use rustc_middle::mir::{ }; use rustc_middle::ty::{Ty, TyCtxt, TypeAndMut}; use rustc_session::Session; +use rustc_target::spec::PanicStrategy; pub struct CheckAlignment; @@ -236,7 +237,11 @@ fn insert_alignment_check<'tcx>( required: Operand::Copy(alignment), found: Operand::Copy(addr), }), - unwind: UnwindAction::Terminate, + unwind: if tcx.sess.panic_strategy() == PanicStrategy::Unwind { + UnwindAction::Terminate + } else { + UnwindAction::Unreachable + }, }, }); } |
