Skip to content

Commit d634f14

Browse files
committed
avoid walk when get_ptr_alloc returns no AllocRef
1 parent 6d03c8d commit d634f14

File tree

1 file changed

+3
-0
lines changed
  • compiler/rustc_const_eval/src/interpret

1 file changed

+3
-0
lines changed

compiler/rustc_const_eval/src/interpret/intern.rs

+3
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ impl<'rt, 'mir, 'tcx: 'mir, M: CompileTimeMachine<'mir, 'tcx, const_eval::Memory
197197
if !alloc.has_relocations() {
198198
return Ok(false);
199199
}
200+
} else {
201+
// We're encountering a ZST here, and can avoid the walk as well.
202+
return Ok(false);
200203
}
201204
}
202205

0 commit comments

Comments
 (0)