Introduce EarlyBinder
This commit is contained in:
parent
ecd44958e0
commit
319575ae8c
66 changed files with 339 additions and 234 deletions
|
@ -16,7 +16,7 @@ use rustc_middle::mir::*;
|
|||
use rustc_middle::thir::*;
|
||||
use rustc_middle::ty::subst::{GenericArg, Subst};
|
||||
use rustc_middle::ty::util::IntTypeExt;
|
||||
use rustc_middle::ty::{self, adjustment::PointerCast, Ty, TyCtxt};
|
||||
use rustc_middle::ty::{self, adjustment::PointerCast, EarlyBinder, Ty, TyCtxt};
|
||||
use rustc_span::def_id::DefId;
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
use rustc_span::Span;
|
||||
|
@ -835,7 +835,7 @@ fn trait_method<'tcx>(
|
|||
.expect("trait method not found");
|
||||
|
||||
let method_ty = tcx.type_of(item.def_id);
|
||||
let method_ty = method_ty.subst(tcx, substs);
|
||||
let method_ty = EarlyBinder(method_ty).subst(tcx, substs);
|
||||
|
||||
ConstantKind::zero_sized(method_ty)
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ use rustc_middle::middle::region;
|
|||
use rustc_middle::mir::*;
|
||||
use rustc_middle::thir::{BindingMode, Expr, ExprId, LintLevel, PatKind, Thir};
|
||||
use rustc_middle::ty::subst::Subst;
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable, TypeckResults};
|
||||
use rustc_middle::ty::{self, EarlyBinder, Ty, TyCtxt, TypeFoldable, TypeckResults};
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_span::Span;
|
||||
use rustc_target::spec::abi::Abi;
|
||||
|
@ -177,7 +177,8 @@ fn mir_build(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> Body<'_
|
|||
let ty = if fn_sig.c_variadic && index == fn_sig.inputs().len() {
|
||||
let va_list_did = tcx.require_lang_item(LangItem::VaList, Some(arg.span));
|
||||
|
||||
tcx.type_of(va_list_did).subst(tcx, &[tcx.lifetimes.re_erased.into()])
|
||||
EarlyBinder(tcx.type_of(va_list_did))
|
||||
.subst(tcx, &[tcx.lifetimes.re_erased.into()])
|
||||
} else {
|
||||
fn_sig.inputs()[index]
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue