about summary refs log tree commit diff
path: root/compiler/rustc_mir_build/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-05-20 16:39:59 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2025-05-27 09:28:39 +1000
commitdf09feddfa7900c841877faa3cda86bfc08d9610 (patch)
tree93fb953b7950cc7ae5c1710e512129acd7ff4426 /compiler/rustc_mir_build/src
parent283db70ace62a0ae704a624e43b68c2ee44b87a6 (diff)
downloadrust-df09feddfa7900c841877faa3cda86bfc08d9610.tar.gz
rust-df09feddfa7900c841877faa3cda86bfc08d9610.zip
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.
Diffstat (limited to 'compiler/rustc_mir_build/src')
-rw-r--r--compiler/rustc_mir_build/src/builder/scope.rs3
1 files changed, 1 insertions, 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 }))
     }