summary refs log tree commit diff
path: root/compiler/rustc_mir_dataflow/src
diff options
context:
space:
mode:
authorMatthew Jasper <mjjasper1@gmail.com>2021-11-05 18:47:52 +0000
committerMatthew Jasper <mjjasper1@gmail.com>2021-11-11 23:15:57 +0000
commitba518ffdd3db0b8f211e410d4f5cd7891f1891ba (patch)
treeaadf309165278cfdd991a47a6fb76d3080b730b1 /compiler/rustc_mir_dataflow/src
parent3ea84e879a40725cc4f73fe36d44ce9e5aa1a5d9 (diff)
downloadrust-ba518ffdd3db0b8f211e410d4f5cd7891f1891ba.tar.gz
rust-ba518ffdd3db0b8f211e410d4f5cd7891f1891ba.zip
Use `associated_item_def_ids` more
Diffstat (limited to 'compiler/rustc_mir_dataflow/src')
-rw-r--r--compiler/rustc_mir_dataflow/src/elaborate_drops.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/compiler/rustc_mir_dataflow/src/elaborate_drops.rs b/compiler/rustc_mir_dataflow/src/elaborate_drops.rs
index 7607ccc3aba..11856f6e047 100644
--- a/compiler/rustc_mir_dataflow/src/elaborate_drops.rs
+++ b/compiler/rustc_mir_dataflow/src/elaborate_drops.rs
@@ -604,7 +604,7 @@ where
         debug!("destructor_call_block({:?}, {:?})", self, succ);
         let tcx = self.tcx();
         let drop_trait = tcx.require_lang_item(LangItem::Drop, None);
-        let drop_fn = tcx.associated_items(drop_trait).in_definition_order().next().unwrap();
+        let drop_fn = tcx.associated_item_def_ids(drop_trait)[0];
         let ty = self.place_ty(self.place);
         let substs = tcx.mk_substs_trait(ty, &[]);
 
@@ -624,12 +624,7 @@ where
             )],
             terminator: Some(Terminator {
                 kind: TerminatorKind::Call {
-                    func: Operand::function_handle(
-                        tcx,
-                        drop_fn.def_id,
-                        substs,
-                        self.source_info.span,
-                    ),
+                    func: Operand::function_handle(tcx, drop_fn, substs, self.source_info.span),
                     args: vec![Operand::Move(Place::from(ref_place))],
                     destination: Some((unit_temp, succ)),
                     cleanup: unwind.into_option(),