Skip to content

Commit 04ab7b2

Browse files
committedJun 17, 2024
Auto merge of #126605 - matthiaskrgr:rollup-plsaytq, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #126255 (fix checking git submodules during a commit hook) - #126355 (Pass target to some run-make tests) - #126567 (Rename `InstanceDef` -> `InstanceKind`) - #126579 (Fix broken documentation link) - #126596 (Add tracking issue number to async_drop APIs) - #126603 (Update books) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 1138036 + d5f9117 commit 04ab7b2

File tree

64 files changed

+472
-461
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+472
-461
lines changed
 

‎compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_hir::intravisit::Visitor;
88
use rustc_hir::{self as hir, BindingMode, ByRef, Node};
99
use rustc_middle::bug;
1010
use rustc_middle::mir::{Mutability, Place, PlaceRef, ProjectionElem};
11-
use rustc_middle::ty::{self, InstanceDef, Ty, TyCtxt, Upcast};
11+
use rustc_middle::ty::{self, InstanceKind, Ty, TyCtxt, Upcast};
1212
use rustc_middle::{
1313
hir::place::PlaceBase,
1414
mir::{self, BindingForm, Local, LocalDecl, LocalInfo, LocalKind, Location},
@@ -1045,7 +1045,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
10451045
fn suggest_using_iter_mut(&self, err: &mut Diag<'_>) {
10461046
let source = self.body.source;
10471047
let hir = self.infcx.tcx.hir();
1048-
if let InstanceDef::Item(def_id) = source.instance
1048+
if let InstanceKind::Item(def_id) = source.instance
10491049
&& let Some(Node::Expr(hir::Expr { hir_id, kind, .. })) = hir.get_if_local(def_id)
10501050
&& let ExprKind::Closure(hir::Closure { kind: hir::ClosureKind::Closure, .. }) = kind
10511051
&& let Node::Expr(expr) = self.infcx.tcx.parent_hir_node(*hir_id)

‎compiler/rustc_codegen_cranelift/src/abi/mod.rs

Lines changed: 7 additions & 7 deletions
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());

0 commit comments

Comments
 (0)
Please sign in to comment.