diff options
| author | Oli Scherer <github333195615777966@oli-obk.de> | 2025-01-07 15:14:46 +0000 |
|---|---|---|
| committer | Oli Scherer <github333195615777966@oli-obk.de> | 2025-01-09 08:48:46 +0000 |
| commit | 8505904dccfb624e663aef3d50f2e5cefefa73d1 (patch) | |
| tree | 3c5b64ea2027238bac7e609782125517cfc620a2 /compiler/rustc_ty_utils/src | |
| parent | 07fcead0732d9460978dd3b428cd5edcfa299f9a (diff) | |
| download | rust-8505904dccfb624e663aef3d50f2e5cefefa73d1.tar.gz rust-8505904dccfb624e663aef3d50f2e5cefefa73d1.zip | |
Remove the now-useless `Result` from `lit_to_const`
Diffstat (limited to 'compiler/rustc_ty_utils/src')
| -rw-r--r-- | compiler/rustc_ty_utils/src/consts.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/compiler/rustc_ty_utils/src/consts.rs b/compiler/rustc_ty_utils/src/consts.rs index 406e23eb879..51a7c976f60 100644 --- a/compiler/rustc_ty_utils/src/consts.rs +++ b/compiler/rustc_ty_utils/src/consts.rs @@ -4,7 +4,7 @@ use rustc_abi::{FIRST_VARIANT, VariantIdx}; use rustc_errors::ErrorGuaranteed; use rustc_hir::def::DefKind; use rustc_hir::def_id::LocalDefId; -use rustc_middle::mir::interpret::{LitToConstError, LitToConstInput}; +use rustc_middle::mir::interpret::LitToConstInput; use rustc_middle::query::Providers; use rustc_middle::thir::visit; use rustc_middle::thir::visit::Visitor; @@ -118,12 +118,7 @@ fn recurse_build<'tcx>( } &ExprKind::Literal { lit, neg } => { let sp = node.span; - match tcx.at(sp).lit_to_const(LitToConstInput { lit: &lit.node, ty: node.ty, neg }) { - Ok(c) => c, - Err(LitToConstError::TypeError) => { - bug!("encountered type error in lit_to_const") - } - } + tcx.at(sp).lit_to_const(LitToConstInput { lit: &lit.node, ty: node.ty, neg }) } &ExprKind::NonHirLiteral { lit, user_ty: _ } => { let val = ty::ValTree::from_scalar_int(lit); |
