Skip to content

Commit 88a5f32

Browse files
committed
Sync from rust 59e2c01c2217a01546222e4d9ff4e6695ee8a1db
2 parents e241176 + 54aa510 commit 88a5f32

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/abi/mod.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ pub(crate) fn codegen_terminator_call<'tcx>(
399399
}
400400

401401
match instance.def {
402-
InstanceDef::Intrinsic(_) => {
402+
InstanceKind::Intrinsic(_) => {
403403
match crate::intrinsics::codegen_intrinsic_call(
404404
fx,
405405
instance,
@@ -412,7 +412,7 @@ pub(crate) fn codegen_terminator_call<'tcx>(
412412
Err(instance) => Some(instance),
413413
}
414414
}
415-
InstanceDef::DropGlue(_, None) | ty::InstanceDef::AsyncDropGlueCtorShim(_, None) => {
415+
InstanceKind::DropGlue(_, None) | ty::InstanceKind::AsyncDropGlueCtorShim(_, None) => {
416416
// empty drop glue - a nop.
417417
let dest = target.expect("Non terminating drop_in_place_real???");
418418
let ret_block = fx.get_block(dest);
@@ -494,7 +494,7 @@ pub(crate) fn codegen_terminator_call<'tcx>(
494494

495495
let (func_ref, first_arg_override) = match instance {
496496
// Trait object call
497-
Some(Instance { def: InstanceDef::Virtual(_, idx), .. }) => {
497+
Some(Instance { def: InstanceKind::Virtual(_, idx), .. }) => {
498498
if fx.clif_comments.enabled() {
499499
let nop_inst = fx.bcx.ins().nop();
500500
fx.add_comment(
@@ -598,7 +598,7 @@ pub(crate) fn codegen_drop<'tcx>(
598598
let ty = drop_place.layout().ty;
599599
let drop_instance = Instance::resolve_drop_in_place(fx.tcx, ty).polymorphize(fx.tcx);
600600

601-
if let ty::InstanceDef::DropGlue(_, None) | ty::InstanceDef::AsyncDropGlueCtorShim(_, None) =
601+
if let ty::InstanceKind::DropGlue(_, None) | ty::InstanceKind::AsyncDropGlueCtorShim(_, None) =
602602
drop_instance.def
603603
{
604604
// we don't actually need to drop anything
@@ -630,7 +630,7 @@ pub(crate) fn codegen_drop<'tcx>(
630630
// FIXME(eddyb) perhaps move some of this logic into
631631
// `Instance::resolve_drop_in_place`?
632632
let virtual_drop = Instance {
633-
def: ty::InstanceDef::Virtual(drop_instance.def_id(), 0),
633+
def: ty::InstanceKind::Virtual(drop_instance.def_id(), 0),
634634
args: drop_instance.args,
635635
};
636636
let fn_abi =
@@ -673,7 +673,7 @@ pub(crate) fn codegen_drop<'tcx>(
673673
fx.bcx.switch_to_block(continued);
674674

675675
let virtual_drop = Instance {
676-
def: ty::InstanceDef::Virtual(drop_instance.def_id(), 0),
676+
def: ty::InstanceKind::Virtual(drop_instance.def_id(), 0),
677677
args: drop_instance.args,
678678
};
679679
let fn_abi =
@@ -684,7 +684,7 @@ pub(crate) fn codegen_drop<'tcx>(
684684
fx.bcx.ins().call_indirect(sig, drop_fn, &[data]);
685685
}
686686
_ => {
687-
assert!(!matches!(drop_instance.def, InstanceDef::Virtual(_, _)));
687+
assert!(!matches!(drop_instance.def, InstanceKind::Virtual(_, _)));
688688

689689
let fn_abi =
690690
RevealAllLayoutCx(fx.tcx).fn_abi_of_instance(drop_instance, ty::List::empty());

src/constant.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub(crate) fn codegen_tls_ref<'tcx>(
5050
) -> CValue<'tcx> {
5151
let tls_ptr = if !def_id.is_local() && fx.tcx.needs_thread_local_shim(def_id) {
5252
let instance = ty::Instance {
53-
def: ty::InstanceDef::ThreadLocalShim(def_id),
53+
def: ty::InstanceKind::ThreadLocalShim(def_id),
5454
args: ty::GenericArgs::empty(),
5555
};
5656
let func_ref = fx.get_function_ref(instance);

src/intrinsics/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
12611261
}
12621262

12631263
// Unimplemented intrinsics must have a fallback body. The fallback body is obtained
1264-
// by converting the `InstanceDef::Intrinsic` to an `InstanceDef::Item`.
1264+
// by converting the `InstanceKind::Intrinsic` to an `InstanceKind::Item`.
12651265
_ => {
12661266
let intrinsic = fx.tcx.intrinsic(instance.def_id()).unwrap();
12671267
if intrinsic.must_be_overridden {

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ mod prelude {
9898
pub(crate) use rustc_middle::mir::{self, *};
9999
pub(crate) use rustc_middle::ty::layout::{LayoutOf, TyAndLayout};
100100
pub(crate) use rustc_middle::ty::{
101-
self, FloatTy, Instance, InstanceDef, IntTy, ParamEnv, Ty, TyCtxt, UintTy,
101+
self, FloatTy, Instance, InstanceKind, IntTy, ParamEnv, Ty, TyCtxt, UintTy,
102102
};
103103
pub(crate) use rustc_span::Span;
104104
pub(crate) use rustc_target::abi::{Abi, FieldIdx, Scalar, Size, VariantIdx, FIRST_VARIANT};

0 commit comments

Comments
 (0)