From df09feddfa7900c841877faa3cda86bfc08d9610 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 20 May 2025 16:39:59 +1000 Subject: Remove `DropNodeKey::kind`. It's not needed, because `next` and `local` fields uniquely identify the drop. This is a ~2% speed win on the very large program in #134404, and it's also a tiny bit simpler. --- compiler/rustc_mir_build/src/builder/scope.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_mir_build/src/builder/scope.rs b/compiler/rustc_mir_build/src/builder/scope.rs index 2a30777e98c..bc39ad6b267 100644 --- a/compiler/rustc_mir_build/src/builder/scope.rs +++ b/compiler/rustc_mir_build/src/builder/scope.rs @@ -230,7 +230,6 @@ struct DropNode { struct DropNodeKey { next: DropIdx, local: Local, - kind: DropKind, } impl Scope { @@ -291,7 +290,7 @@ impl DropTree { let drops = &mut self.drops; *self .existing_drops_map - .entry(DropNodeKey { next, local: data.local, kind: data.kind }) + .entry(DropNodeKey { next, local: data.local }) // Create a new node, and also add its index to the map. .or_insert_with(|| drops.push(DropNode { data, next })) } -- cgit 1.4.1-3-g733a5