diff options
| author | Jakob Degen <jakob.e.degen@gmail.com> | 2022-12-03 16:03:27 -0800 |
|---|---|---|
| committer | Jakob Degen <jakob.e.degen@gmail.com> | 2022-12-09 04:53:10 -0800 |
| commit | 9fb8da8f8ff1a0b2c237c691fee58b6348811b86 (patch) | |
| tree | 8b3c32c7333890a7f54a1cab61a30a89c7c30d80 /compiler/rustc_const_eval/src/transform/validate.rs | |
| parent | 14ca83a04b00433a8caf3b805d5ea08cb2691e1b (diff) | |
| download | rust-9fb8da8f8ff1a0b2c237c691fee58b6348811b86.tar.gz rust-9fb8da8f8ff1a0b2c237c691fee58b6348811b86.zip | |
Remove unneeded field from `SwitchTargets`
Diffstat (limited to 'compiler/rustc_const_eval/src/transform/validate.rs')
| -rw-r--r-- | compiler/rustc_const_eval/src/transform/validate.rs | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/compiler/rustc_const_eval/src/transform/validate.rs b/compiler/rustc_const_eval/src/transform/validate.rs index 5c9263dc5e3..64318f5f54d 100644 --- a/compiler/rustc_const_eval/src/transform/validate.rs +++ b/compiler/rustc_const_eval/src/transform/validate.rs @@ -686,17 +686,8 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> { TerminatorKind::Goto { target } => { self.check_edge(location, *target, EdgeKind::Normal); } - TerminatorKind::SwitchInt { targets, switch_ty, discr } => { - let ty = discr.ty(&self.body.local_decls, self.tcx); - if ty != *switch_ty { - self.fail( - location, - format!( - "encountered `SwitchInt` terminator with type mismatch: {:?} != {:?}", - ty, switch_ty, - ), - ); - } + TerminatorKind::SwitchInt { targets, discr } => { + let switch_ty = discr.ty(&self.body.local_decls, self.tcx); let target_width = self.tcx.sess.target.pointer_width; |
