From 8968c8a103cd69202e4312ad497e641a8f027e88 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Sun, 3 Jan 2021 15:19:07 +0100 Subject: [PATCH] Dangling pointers point to everything and nothing Co-authored-by: Ralf Jung --- compiler/rustc_mir/src/transform/check_consts/validation.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_mir/src/transform/check_consts/validation.rs b/compiler/rustc_mir/src/transform/check_consts/validation.rs index 0e3dfb44228..d1c07d1051d 100644 --- a/compiler/rustc_mir/src/transform/check_consts/validation.rs +++ b/compiler/rustc_mir/src/transform/check_consts/validation.rs @@ -595,8 +595,7 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> { // Locals with StorageDead are definitely not part of the final constant value, and // it is thus inherently safe to permit such locals to have their // address taken as we can't end up with a reference to them in the - // final value without creating a dangling pointer, which will cause - // errors during validation. + // final value. // Note: This is only sound if every local that has a `StorageDead` has a // `StorageDead` in every control flow path leading to a `return` terminator. if self.local_has_storage_dead(place.local) {