File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
rustc_query_system/src/query Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -529,8 +529,7 @@ impl<'s> LintLevelsBuilder<'s, TopDown> {
529529
530530 /// Called after `push` when the scope of a set of attributes are exited.
531531 pub ( crate ) fn pop ( & mut self , push : BuilderPush ) {
532- self . provider . cur = push. prev ;
533- std:: mem:: forget ( push) ;
532+ self . provider . cur = std:: mem:: ManuallyDrop :: new ( push) . prev ;
534533 }
535534}
536535
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ use std::cell::Cell;
2525use std:: collections:: hash_map:: Entry ;
2626use std:: fmt:: Debug ;
2727use std:: hash:: Hash ;
28- use std:: mem;
28+ use std:: mem:: ManuallyDrop ;
2929use thin_vec:: ThinVec ;
3030use tracing:: instrument;
3131
@@ -169,11 +169,11 @@ where
169169 where
170170 C : QueryCache < Key = K > ,
171171 {
172- let key = self . key ;
173- let state = self . state ;
174-
175172 // Forget ourself so our destructor won't poison the query
176- mem:: forget ( self ) ;
173+ let this = ManuallyDrop :: new ( self ) ;
174+
175+ let key = this. key ;
176+ let state = this. state ;
177177
178178 // Mark as complete before we remove the job from the active state
179179 // so no other thread can re-execute this query.
You can’t perform that action at this time.
0 commit comments