Skip to content

Commit df09fed

Browse files
committed
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.
1 parent 283db70 commit df09fed

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

  • compiler/rustc_mir_build/src/builder

‎compiler/rustc_mir_build/src/builder/scope.rs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ struct DropNode {
230230
structDropNodeKey{
231231
next:DropIdx,
232232
local:Local,
233-
kind:DropKind,
234233
}
235234

236235
implScope{
@@ -291,7 +290,7 @@ impl DropTree {
291290
let drops = &mutself.drops;
292291
*self
293292
.existing_drops_map
294-
.entry(DropNodeKey{ next,local: data.local,kind: data.kind})
293+
.entry(DropNodeKey{ next,local: data.local})
295294
// Create a new node, and also add its index to the map.
296295
.or_insert_with(|| drops.push(DropNode{ data, next }))
297296
}

0 commit comments

Comments
 (0)