1
Fork 0

Introduce EarlyBinder

This commit is contained in:
Jack Huey 2022-05-08 01:17:58 -04:00
parent ecd44958e0
commit 319575ae8c
66 changed files with 339 additions and 234 deletions

View file

@ -6,7 +6,7 @@ use rustc_middle::mir::*;
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};
@ -90,7 +90,7 @@ impl<'tcx> FunctionItemRefChecker<'_, 'tcx> {
// 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)
{