diff options
| author | Ralf Jung <post@ralfj.de> | 2024-03-10 11:49:27 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-03-10 11:49:33 +0100 |
| commit | aa9145e6ea9ae518355b2c8c7f6de6d61c385e38 (patch) | |
| tree | 3879e04522105863a96f4a018cd4861ec177674e /compiler/rustc_const_eval/src | |
| parent | 094a6204f590e6b4770b5f26359dd17a07897adf (diff) | |
| download | rust-aa9145e6ea9ae518355b2c8c7f6de6d61c385e38.tar.gz rust-aa9145e6ea9ae518355b2c8c7f6de6d61c385e38.zip | |
use Instance::expect_resolve() instead of unwraping Instance::resolve()
Diffstat (limited to 'compiler/rustc_const_eval/src')
| -rw-r--r-- | compiler/rustc_const_eval/src/const_eval/machine.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs index 6736fc749c0..f104b836716 100644 --- a/compiler/rustc_const_eval/src/const_eval/machine.rs +++ b/compiler/rustc_const_eval/src/const_eval/machine.rs @@ -243,14 +243,12 @@ impl<'mir, 'tcx: 'mir> CompileTimeEvalContext<'mir, 'tcx> { } else if Some(def_id) == self.tcx.lang_items().panic_fmt() { // For panic_fmt, call const_panic_fmt instead. let const_def_id = self.tcx.require_lang_item(LangItem::ConstPanicFmt, None); - let new_instance = ty::Instance::resolve( + let new_instance = ty::Instance::expect_resolve( *self.tcx, ty::ParamEnv::reveal_all(), const_def_id, instance.args, - ) - .unwrap() - .unwrap(); + ); return Ok(Some(new_instance)); } else if Some(def_id) == self.tcx.lang_items().align_offset_fn() { |
