@@ -59,7 +59,8 @@ enum InternMode {
59
59
struct IsStaticOrFn ;
60
60
61
61
impl < ' rt , ' a , ' mir , ' tcx > InternVisitor < ' rt , ' a , ' mir , ' tcx > {
62
- fn intern (
62
+ /// Intern an allocation without looking at its children
63
+ fn intern_shallow (
63
64
& mut self ,
64
65
ptr : Pointer ,
65
66
mutability : Mutability ,
152
153
if let Ok ( vtable) = meta. unwrap ( ) . to_ptr ( ) {
153
154
// explitly choose `Immutable` here, since vtables are immutable, even
154
155
// if the reference of the fat pointer is mutable
155
- self . intern ( vtable, Mutability :: Immutable ) ?;
156
+ self . intern_shallow ( vtable, Mutability :: Immutable ) ?;
156
157
}
157
158
}
158
159
}
206
207
InternMode :: ConstBase => InternMode :: Const ,
207
208
other => other,
208
209
} ;
209
- match self . intern ( ptr, intern_mutability) ? {
210
+ match self . intern_shallow ( ptr, intern_mutability) ? {
210
211
// No need to recurse, these are interned already and statics may have
211
212
// cycles, so we don't want to recurse there
212
213
Some ( IsStaticOrFn ) => { } ,
@@ -270,7 +271,7 @@ pub fn intern_const_alloc_recursive(
270
271
leftover_relocations,
271
272
param_env,
272
273
mutability,
273
- } . intern ( ret. ptr . to_ptr ( ) ?, alloc_mutability) ?;
274
+ } . intern_shallow ( ret. ptr . to_ptr ( ) ?, alloc_mutability) ?;
274
275
275
276
while let Some ( ( ( mplace, mutability, mode) , _) ) = ref_tracking. todo . pop ( ) {
276
277
let interned = InternVisitor {
0 commit comments