1
Fork 0

Rollup merge of #122286 - RalfJung:resolve, r=compiler-errors

use Instance::expect_resolve() instead of unwraping Instance::resolve()
This commit is contained in:
Matthias Krüger 2024-03-10 22:16:43 +01:00 committed by GitHub
commit b02f2a0e76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 20 additions and 33 deletions

View file

@ -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() {