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 | 01affeb53a32f2e29bb90ebd3eff4c4c687e6746 (patch) | |
| tree | b53f4166cff404d1fcbb4c79d819f3f7bf04bf0c /src | |
| parent | ef862a707b696a4a57f6126ebad7b0cc42af98f0 (diff) | |
| download | rust-01affeb53a32f2e29bb90ebd3eff4c4c687e6746.tar.gz rust-01affeb53a32f2e29bb90ebd3eff4c4c687e6746.zip | |
use Instance::expect_resolve() instead of unwraping Instance::resolve()
Diffstat (limited to 'src')
| -rw-r--r-- | src/main_shim.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/main_shim.rs b/src/main_shim.rs index 6535c3a367b..1abfded8b11 100644 --- a/src/main_shim.rs +++ b/src/main_shim.rs @@ -115,14 +115,12 @@ pub(crate) fn maybe_create_entry_wrapper( termination_trait, ) .unwrap(); - let report = Instance::resolve( + let report = Instance::expect_resolve( tcx, ParamEnv::reveal_all(), report.def_id, tcx.mk_args(&[GenericArg::from(main_ret_ty)]), ) - .unwrap() - .unwrap() .polymorphize(tcx); let report_name = tcx.symbol_name(report).name; @@ -142,14 +140,12 @@ pub(crate) fn maybe_create_entry_wrapper( } } else if is_main_fn { let start_def_id = tcx.require_lang_item(LangItem::Start, None); - let start_instance = Instance::resolve( + let start_instance = Instance::expect_resolve( tcx, ParamEnv::reveal_all(), start_def_id, tcx.mk_args(&[main_ret_ty.into()]), ) - .unwrap() - .unwrap() .polymorphize(tcx); let start_func_id = import_function(tcx, m, start_instance); |
