1
Fork 0

change fn_sig query to use EarlyBinder; remove bound_fn_sig query; add EarlyBinder to fn_sig in metadata

This commit is contained in:
Kyle Matsuda 2023-01-18 16:52:47 -07:00
parent e982971ff2
commit c2414dfaa4
80 changed files with 142 additions and 152 deletions

View file

@ -79,8 +79,7 @@ impl<'tcx> FunctionItemRefChecker<'_, 'tcx> {
for bound in bounds {
if let Some(bound_ty) = self.is_pointer_trait(&bound.kind().skip_binder()) {
// Get the argument types as they appear in the function signature.
let arg_defs =
self.tcx.bound_fn_sig(def_id).subst_identity().skip_binder().inputs();
let arg_defs = self.tcx.fn_sig(def_id).subst_identity().skip_binder().inputs();
for (arg_num, arg_def) in arg_defs.iter().enumerate() {
// For all types reachable from the argument type in the fn sig
for generic_inner_ty in arg_def.walk() {
@ -162,7 +161,7 @@ impl<'tcx> FunctionItemRefChecker<'_, 'tcx> {
.as_ref()
.assert_crate_local()
.lint_root;
let fn_sig = self.tcx.bound_fn_sig(fn_id).skip_binder();
let fn_sig = self.tcx.fn_sig(fn_id).skip_binder();
let unsafety = fn_sig.unsafety().prefix_str();
let abi = match fn_sig.abi() {
Abi::Rust => String::from(""),

View file

@ -331,7 +331,7 @@ impl<'tcx> Inliner<'tcx> {
return None;
}
let fn_sig = self.tcx.bound_fn_sig(def_id).subst(self.tcx, substs);
let fn_sig = self.tcx.fn_sig(def_id).subst(self.tcx, substs);
let source_info = SourceInfo { span: fn_span, ..terminator.source_info };
return Some(CallSite { callee, fn_sig, block: bb, target, source_info });

View file

@ -152,7 +152,7 @@ fn build_drop_shim<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, ty: Option<Ty<'tcx>>)
} else {
InternalSubsts::identity_for_item(tcx, def_id)
};
let sig = tcx.bound_fn_sig(def_id).subst(tcx, substs);
let sig = tcx.fn_sig(def_id).subst(tcx, substs);
let sig = tcx.erase_late_bound_regions(sig);
let span = tcx.def_span(def_id);
@ -363,7 +363,7 @@ impl<'tcx> CloneShimBuilder<'tcx> {
// we must subst the self_ty because it's
// otherwise going to be TySelf and we can't index
// or access fields of a Place of type TySelf.
let sig = tcx.bound_fn_sig(def_id).subst(tcx, &[self_ty.into()]);
let sig = tcx.fn_sig(def_id).subst(tcx, &[self_ty.into()]);
let sig = tcx.erase_late_bound_regions(sig);
let span = tcx.def_span(def_id);
@ -606,7 +606,7 @@ fn build_call_shim<'tcx>(
};
let def_id = instance.def_id();
let sig = tcx.bound_fn_sig(def_id);
let sig = tcx.fn_sig(def_id);
let sig = sig.map_bound(|sig| tcx.erase_late_bound_regions(sig));
assert_eq!(sig_substs.is_some(), !instance.has_polymorphic_mir_body());
@ -799,7 +799,7 @@ pub fn build_adt_ctor(tcx: TyCtxt<'_>, ctor_id: DefId) -> Body<'_> {
// Normalize the sig.
let sig = tcx
.bound_fn_sig(ctor_id)
.fn_sig(ctor_id)
.subst_identity()
.no_bound_vars()
.expect("LBR in ADT constructor signature");