diff options
| author | Ralf Jung <post@ralfj.de> | 2025-07-29 17:22:22 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2025-08-14 09:44:22 +0200 |
| commit | e2cc7757e1bdbe8c9dc0dcffc1017ceff4799899 (patch) | |
| tree | 1164d3542a380408431653bb7a0c50ac55a96e83 /compiler/rustc_mir_build | |
| parent | dbc030e0346f0958bea91601de7d115554bbf74e (diff) | |
| download | rust-e2cc7757e1bdbe8c9dc0dcffc1017ceff4799899.tar.gz rust-e2cc7757e1bdbe8c9dc0dcffc1017ceff4799899.zip | |
avoid unnecessary type sanity checks
Diffstat (limited to 'compiler/rustc_mir_build')
| -rw-r--r-- | compiler/rustc_mir_build/src/builder/custom/parse/instruction.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_mir_build/src/builder/matches/test.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_mir_build/src/builder/custom/parse/instruction.rs b/compiler/rustc_mir_build/src/builder/custom/parse/instruction.rs index 50e8fb15cab..41d3aefcbe6 100644 --- a/compiler/rustc_mir_build/src/builder/custom/parse/instruction.rs +++ b/compiler/rustc_mir_build/src/builder/custom/parse/instruction.rs @@ -160,7 +160,7 @@ impl<'a, 'tcx> ParseCtxt<'a, 'tcx> { }); } }; - values.push(value.try_to_scalar_int().unwrap().to_bits_unchecked()); + values.push(value.valtree.unwrap_leaf().to_bits_unchecked()); targets.push(self.parse_block(arm.body)?); } diff --git a/compiler/rustc_mir_build/src/builder/matches/test.rs b/compiler/rustc_mir_build/src/builder/matches/test.rs index f2f708bddce..cefc3d0bf14 100644 --- a/compiler/rustc_mir_build/src/builder/matches/test.rs +++ b/compiler/rustc_mir_build/src/builder/matches/test.rs @@ -113,7 +113,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let switch_targets = SwitchTargets::new( target_blocks.iter().filter_map(|(&branch, &block)| { if let TestBranch::Constant(value) = branch { - let bits = value.try_to_scalar_int().unwrap().to_bits_unchecked(); + let bits = value.valtree.unwrap_leaf().to_bits_unchecked(); Some((bits, block)) } else { None |
