refactor(rustc_middle): Substs -> GenericArg

This commit is contained in:
Mahdi Dibaiee 2023-07-11 22:35:29 +01:00
parent df5c2cf9bc
commit e55583c4b8
466 changed files with 4574 additions and 4604 deletions

View file

@ -178,12 +178,12 @@ fn require_same_types<'tcx>(
}
fn check_main_fn_ty(tcx: TyCtxt<'_>, main_def_id: DefId) {
let main_fnsig = tcx.fn_sig(main_def_id).subst_identity();
let main_fnsig = tcx.fn_sig(main_def_id).instantiate_identity();
let main_span = tcx.def_span(main_def_id);
fn main_fn_diagnostics_def_id(tcx: TyCtxt<'_>, def_id: DefId, sp: Span) -> LocalDefId {
if let Some(local_def_id) = def_id.as_local() {
let hir_type = tcx.type_of(local_def_id).subst_identity();
let hir_type = tcx.type_of(local_def_id).instantiate_identity();
if !matches!(hir_type.kind(), ty::FnDef(..)) {
span_bug!(sp, "main has a non-function type: found `{}`", hir_type);
}
@ -350,7 +350,7 @@ fn check_start_fn_ty(tcx: TyCtxt<'_>, start_def_id: DefId) {
let start_def_id = start_def_id.expect_local();
let start_id = tcx.hir().local_def_id_to_hir_id(start_def_id);
let start_span = tcx.def_span(start_def_id);
let start_t = tcx.type_of(start_def_id).subst_identity();
let start_t = tcx.type_of(start_def_id).instantiate_identity();
match start_t.kind() {
ty::FnDef(..) => {
if let Some(Node::Item(it)) = tcx.hir().find(start_id) {
@ -421,7 +421,7 @@ fn check_start_fn_ty(tcx: TyCtxt<'_>, start_def_id: DefId) {
),
ty::ParamEnv::empty(), // start should not have any where bounds.
se_ty,
Ty::new_fn_ptr(tcx, tcx.fn_sig(start_def_id).subst_identity()),
Ty::new_fn_ptr(tcx, tcx.fn_sig(start_def_id).instantiate_identity()),
);
}
_ => {