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

@ -41,7 +41,7 @@ fn fn_sig_for_fn_abi<'tcx>(
// We normalize the `fn_sig` again after substituting at a later point.
let mut sig = match *ty.kind() {
ty::FnDef(def_id, substs) => tcx
.bound_fn_sig(def_id)
.fn_sig(def_id)
.map_bound(|fn_sig| {
tcx.normalize_erasing_regions(tcx.param_env(def_id), fn_sig)
})

View file

@ -9,12 +9,12 @@ pub fn provide(providers: &mut ty::query::Providers) {
fn assumed_wf_types(tcx: TyCtxt<'_>, def_id: DefId) -> &ty::List<Ty<'_>> {
match tcx.def_kind(def_id) {
DefKind::Fn => {
let sig = tcx.bound_fn_sig(def_id).skip_binder();
let sig = tcx.fn_sig(def_id).skip_binder();
let liberated_sig = tcx.liberate_late_bound_regions(def_id, sig);
liberated_sig.inputs_and_output
}
DefKind::AssocFn => {
let sig = tcx.bound_fn_sig(def_id).skip_binder();
let sig = tcx.fn_sig(def_id).skip_binder();
let liberated_sig = tcx.liberate_late_bound_regions(def_id, sig);
let mut assumed_wf_types: Vec<_> =
tcx.assumed_wf_types(tcx.parent(def_id)).as_slice().into();

View file

@ -299,7 +299,7 @@ fn well_formed_types_in_env(tcx: TyCtxt<'_>, def_id: DefId) -> &ty::List<Predica
// In an fn, we assume that the arguments and all their constituents are
// well-formed.
NodeKind::Fn => {
let fn_sig = tcx.bound_fn_sig(def_id).subst_identity();
let fn_sig = tcx.fn_sig(def_id).subst_identity();
let fn_sig = tcx.liberate_late_bound_regions(def_id, fn_sig);
inputs.extend(fn_sig.inputs().iter().flat_map(|ty| ty.walk()));