Rollup merge of #119725 - compiler-errors:has_effect_param, r=fmease

Add helper for when we want to know if an item has a host param

r? ````@fmease```` since you're a good reviewer and no good deed goes unpunished

This helper will see far more usages as built-in traits get constified.
This commit is contained in:
Matthias Krüger
2024-01-09 00:19:36 +01:00
committed by GitHub
4 changed files with 13 additions and 10 deletions

View File

@@ -271,7 +271,7 @@ pub fn closure_trait_ref_and_return_type<'tcx>(
TupleArgumentsFlag::No => sig.skip_binder().inputs()[0],
TupleArgumentsFlag::Yes => Ty::new_tup(tcx, sig.skip_binder().inputs()),
};
let trait_ref = if tcx.generics_of(fn_trait_def_id).host_effect_index.is_some() {
let trait_ref = if tcx.has_host_param(fn_trait_def_id) {
ty::TraitRef::new(
tcx,
fn_trait_def_id,