Skip to content

Commit 8968c8a

Browse files
oli-obkRalfJung
andauthored
Dangling pointers point to everything and nothing
Co-authored-by: Ralf Jung <post@ralfj.de>
1 parent e5e4a85 commit 8968c8a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compiler/rustc_mir/src/transform/check_consts/validation.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,7 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
595595
// Locals with StorageDead are definitely not part of the final constant value, and
596596
// it is thus inherently safe to permit such locals to have their
597597
// address taken as we can't end up with a reference to them in the
598-
// final value without creating a dangling pointer, which will cause
599-
// errors during validation.
598+
// final value.
600599
// Note: This is only sound if every local that has a `StorageDead` has a
601600
// `StorageDead` in every control flow path leading to a `return` terminator.
602601
if self.local_has_storage_dead(place.local) {

0 commit comments

Comments
 (0)