about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOli Scherer <github35764891676564198441@oli-obk.de>2021-01-03 15:19:07 +0100
committerGitHub <noreply@github.com>2021-01-03 15:19:07 +0100
commit8968c8a103cd69202e4312ad497e641a8f027e88 (patch)
tree7108fab125aab8a59aaba36a5b3f4bd90841d673
parente5e4a851c493a739a18d69794f5c7f3ab943b412 (diff)
downloadrust-8968c8a103cd69202e4312ad497e641a8f027e88.tar.gz
rust-8968c8a103cd69202e4312ad497e641a8f027e88.zip
Dangling pointers point to everything and nothing
Co-authored-by: Ralf Jung <post@ralfj.de>
-rw-r--r--compiler/rustc_mir/src/transform/check_consts/validation.rs3
1 files changed, 1 insertions, 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) {