@@ -168,18 +168,18 @@ impl<'rt, 'mir, 'tcx: 'mir, M: CompileTimeMachine<'mir, 'tcx, const_eval::Memory
168
168
mplace : & MPlaceTy < ' tcx > ,
169
169
fields : impl Iterator < Item = InterpResult < ' tcx , Self :: V > > ,
170
170
) -> InterpResult < ' tcx > {
171
- // We want to walk the aggregate to look for reference types to intern. While doing that we
171
+ // We want to walk the aggregate to look for references to intern. While doing that we
172
172
// also need to take special care of interior mutability.
173
173
//
174
- // As an optimization, however, if the allocation does not contain any pointers : we don't
174
+ // As an optimization, however, if the allocation does not contain any references : we don't
175
175
// need to do the walk. It can be costly for big arrays for example (e.g. issue #93215).
176
176
let is_walk_needed = |mplace : & MPlaceTy < ' tcx > | -> InterpResult < ' tcx , bool > {
177
177
// ZSTs cannot contain pointers, we can avoid the interning walk.
178
178
if mplace. layout . is_zst ( ) {
179
179
return Ok ( false ) ;
180
180
}
181
181
182
- // Now, check whether this allocation contains reference types (as relocations) .
182
+ // Now, check whether this allocation could contain references .
183
183
//
184
184
// Note, this check may sometimes not be cheap, so we only do it when the walk we'd like
185
185
// to avoid could be expensive: on the potentially larger types, arrays and slices,
@@ -191,8 +191,8 @@ impl<'rt, 'mir, 'tcx: 'mir, M: CompileTimeMachine<'mir, 'tcx, const_eval::Memory
191
191
return Ok ( true ) ;
192
192
} ;
193
193
194
- // If there are no refs or relocations in this allocation, we can avoid the
195
- // interning walk.
194
+ // If there are no relocations in this allocation, it does not contain references
195
+ // that point to another allocation, and we can avoid the interning walk.
196
196
if let Some ( alloc) = self . ecx . get_ptr_alloc ( mplace. ptr , size, align) ? {
197
197
if !alloc. has_relocations ( ) {
198
198
return Ok ( false ) ;
0 commit comments