use rustc_middle::ty::{
self,
subst::{GenericArgKind, Subst, SubstsRef},
- PredicateKind, Ty, TyCtxt,
+ EarlyBinder, PredicateKind, Ty, TyCtxt,
};
use rustc_session::lint::builtin::FUNCTION_ITEM_REFERENCES;
use rustc_span::{symbol::sym, Span};
// If the inner type matches the type bound by `Pointer`
if inner_ty == bound_ty {
// Do a substitution using the parameters from the callsite
- let subst_ty = inner_ty.subst(self.tcx, substs_ref);
+ let subst_ty = EarlyBinder(inner_ty).subst(self.tcx, substs_ref);
if let Some((fn_id, fn_substs)) =
FunctionItemRefChecker::is_fn_ref(subst_ty)
{