@@ -59,7 +59,8 @@ enum InternMode {
5959struct IsStaticOrFn ;
6060
6161impl < ' 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 (
6364 & mut self ,
6465 ptr : Pointer ,
6566 mutability : Mutability ,
152153 if let Ok ( vtable) = meta. unwrap ( ) . to_ptr ( ) {
153154 // explitly choose `Immutable` here, since vtables are immutable, even
154155 // if the reference of the fat pointer is mutable
155- self . intern ( vtable, Mutability :: Immutable ) ?;
156+ self . intern_shallow ( vtable, Mutability :: Immutable ) ?;
156157 }
157158 }
158159 }
206207 InternMode :: ConstBase => InternMode :: Const ,
207208 other => other,
208209 } ;
209- match self . intern ( ptr, intern_mutability) ? {
210+ match self . intern_shallow ( ptr, intern_mutability) ? {
210211 // No need to recurse, these are interned already and statics may have
211212 // cycles, so we don't want to recurse there
212213 Some ( IsStaticOrFn ) => { } ,
@@ -270,7 +271,7 @@ pub fn intern_const_alloc_recursive(
270271 leftover_relocations,
271272 param_env,
272273 mutability,
273- } . intern ( ret. ptr . to_ptr ( ) ?, alloc_mutability) ?;
274+ } . intern_shallow ( ret. ptr . to_ptr ( ) ?, alloc_mutability) ?;
274275
275276 while let Some ( ( ( mplace, mutability, mode) , _) ) = ref_tracking. todo . pop ( ) {
276277 let interned = InternVisitor {
0 commit comments