Move TyCtxt::mk_x to Ty::new_x where applicable

This commit is contained in:
Boxy
2023-07-05 20:13:26 +01:00
parent 5dac6b320b
commit 12138b8e5e
164 changed files with 1386 additions and 1185 deletions

View File

@@ -343,7 +343,7 @@ fn emit_orphan_check_error<'tcx>(
// That way if we had `Vec<MyType>`, we will properly attribute the
// problem to `Vec<T>` and avoid confusing the user if they were to see
// `MyType` in the error.
ty::Adt(def, _) => tcx.mk_adt(*def, ty::List::empty()),
ty::Adt(def, _) => Ty::new_adt(tcx, *def, ty::List::empty()),
_ => ty,
};
let msg = |ty: &str, postfix: &str| {
@@ -605,7 +605,9 @@ fn fast_reject_auto_impl<'tcx>(tcx: TyCtxt<'tcx>, trait_def_id: DefId, self_ty:
}
let self_ty_root = match self_ty.kind() {
ty::Adt(def, _) => tcx.mk_adt(*def, InternalSubsts::identity_for_item(tcx, def.did())),
ty::Adt(def, _) => {
Ty::new_adt(tcx, *def, InternalSubsts::identity_for_item(tcx, def.did()))
}
_ => unimplemented!("unexpected self ty {:?}", self_ty),
};