diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-12-10 15:01:43 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-10 15:01:43 +0100 |
| commit | b66e123677ac5f4fade3bb67888f8f40f0bb28ec (patch) | |
| tree | 623f393adada7b987da150cc2d4e97ab7c25132e /compiler/rustc_codegen_ssa/src | |
| parent | 7e1857db1eb948353812a3d3a688e4a5cb58defa (diff) | |
| parent | 9fb8da8f8ff1a0b2c237c691fee58b6348811b86 (diff) | |
| download | rust-b66e123677ac5f4fade3bb67888f8f40f0bb28ec.tar.gz rust-b66e123677ac5f4fade3bb67888f8f40f0bb28ec.zip | |
Rollup merge of #105234 - JakobDegen:unneeded-field, r=oli-obk
Remove unneeded field from `SwitchTargets` This had a fixme already. The only change in behavior is that the mir dumps now no longer contains labels for the types of the integers on the edges of a switchint: Before:  After:  I don't think that's a problem though. The information is still available to a user that really cares by checking the type of `_2`, so it honestly feels like a bit of an improvement to me. r? mir
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/block.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs index 03d833fbba8..f3f5ddb52d6 100644 --- a/compiler/rustc_codegen_ssa/src/mir/block.rs +++ b/compiler/rustc_codegen_ssa/src/mir/block.rs @@ -307,12 +307,10 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { helper: TerminatorCodegenHelper<'tcx>, bx: &mut Bx, discr: &mir::Operand<'tcx>, - switch_ty: Ty<'tcx>, targets: &SwitchTargets, ) { let discr = self.codegen_operand(bx, &discr); - // `switch_ty` is redundant, sanity-check that. - assert_eq!(discr.layout.ty, switch_ty); + let switch_ty = discr.layout.ty; let mut target_iter = targets.iter(); if target_iter.len() == 1 { // If there are two targets (one conditional, one fallback), emit `br` instead of @@ -1293,8 +1291,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { helper.funclet_br(self, bx, target, mergeable_succ()) } - mir::TerminatorKind::SwitchInt { ref discr, switch_ty, ref targets } => { - self.codegen_switchint_terminator(helper, bx, discr, switch_ty, targets); + mir::TerminatorKind::SwitchInt { ref discr, ref targets } => { + self.codegen_switchint_terminator(helper, bx, discr, targets); MergingSucc::False } |
