File tree 2 files changed +6
-7
lines changed
rustc_query_system/src/query
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> {
529
529
530
530
/// Called after `push` when the scope of a set of attributes are exited.
531
531
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 ;
534
533
}
535
534
}
536
535
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ use std::cell::Cell;
25
25
use std:: collections:: hash_map:: Entry ;
26
26
use std:: fmt:: Debug ;
27
27
use std:: hash:: Hash ;
28
- use std:: mem;
28
+ use std:: mem:: ManuallyDrop ;
29
29
use thin_vec:: ThinVec ;
30
30
use tracing:: instrument;
31
31
@@ -169,11 +169,11 @@ where
169
169
where
170
170
C : QueryCache < Key = K > ,
171
171
{
172
- let key = self . key ;
173
- let state = self . state ;
174
-
175
172
// 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 ;
177
177
178
178
// Mark as complete before we remove the job from the active state
179
179
// so no other thread can re-execute this query.
You can’t perform that action at this time.
0 commit comments