1
Fork 0

Auto merge of #107055 - kylematsuda:eb-fn-sig, r=lcnr

Switch to `EarlyBinder` for `fn_sig` query

Part of the work to finish #105779 (also see https://github.com/rust-lang/types-team/issues/78).

Several queries `X` have a `bound_X` variant that wraps the output in [`EarlyBinder`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/subst/struct.EarlyBinder.html). This adds `EarlyBinder` to the return type of the `fn_sig` query and removes `bound_fn_sig`.

r? `@lcnr`
This commit is contained in:
bors 2023-01-27 15:02:44 +00:00
commit 7919ef0ec5
86 changed files with 192 additions and 171 deletions

View file

@ -184,7 +184,7 @@ pub(crate) fn extract_tupled_inputs_and_output_from_callable<'tcx>(
) -> Result<Option<ty::Binder<'tcx, (Ty<'tcx>, Ty<'tcx>)>>, NoSolution> {
match *self_ty.kind() {
ty::FnDef(def_id, substs) => Ok(Some(
tcx.bound_fn_sig(def_id)
tcx.fn_sig(def_id)
.subst(tcx, substs)
.map_bound(|sig| (tcx.mk_tup(sig.inputs().iter()), sig.output())),
)),

View file

@ -395,7 +395,7 @@ fn virtual_call_violation_for_method<'tcx>(
trait_def_id: DefId,
method: &ty::AssocItem,
) -> Option<MethodViolationCode> {
let sig = tcx.fn_sig(method.def_id);
let sig = tcx.fn_sig(method.def_id).subst_identity();
// The method's first parameter must be named `self`
if !method.fn_has_self_parameter {