Skip to content

Commit 98bf737

Browse files
committed
s/intern/intern_shallow/
1 parent 104b108 commit 98bf737

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/librustc_mir/interpret/intern.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ enum InternMode {
5959
struct IsStaticOrFn;
6060

6161
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(
6364
&mut self,
6465
ptr: Pointer,
6566
mutability: Mutability,
@@ -152,7 +153,7 @@ for
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
}
@@ -206,7 +207,7 @@ for
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

Comments
 (0)