We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a51a205 commit 265e1e9Copy full SHA for 265e1e9
compiler/rustc_middle/src/ty/query.rs
@@ -63,6 +63,7 @@ use rustc_span::symbol::Symbol;
63
use rustc_span::{Span, DUMMY_SP};
64
use rustc_target::abi;
65
use rustc_target::spec::PanicStrategy;
66
+use std::mem;
67
use std::ops::Deref;
68
use std::path::PathBuf;
69
use std::sync::Arc;
@@ -230,7 +231,13 @@ macro_rules! define_callbacks {
230
231
value: query_provided::$name<'tcx>,
232
) -> query_values::$name<'tcx> {
233
query_if_arena!([$($modifiers)*]
- (&*_tcx.query_system.arenas.$name.alloc(value))
234
+ {
235
+ if mem::needs_drop::<query_provided::$name<'tcx>>() {
236
+ &*_tcx.query_system.arenas.$name.alloc(value)
237
+ } else {
238
+ &*_tcx.arena.dropless.alloc(value)
239
+ }
240
241
(value)
242
)
243
}
0 commit comments