about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-08-21 15:52:06 +0200
committerRalf Jung <post@ralfj.de>2024-08-21 15:52:06 +0200
commit9010708d9f5dc7e3377acc116a64573fadc7ed2b (patch)
treeea5e898cac41a5b5136d0a37ef1c4510da5c0a3e
parent59a74db37df8628f778faf75faa41958bb07a42a (diff)
downloadrust-9010708d9f5dc7e3377acc116a64573fadc7ed2b.tar.gz
rust-9010708d9f5dc7e3377acc116a64573fadc7ed2b.zip
fix comment on PlaceMention semantics
-rw-r--r--compiler/rustc_middle/src/mir/syntax.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/mir/syntax.rs b/compiler/rustc_middle/src/mir/syntax.rs
index 51b4154ddab..748ca047754 100644
--- a/compiler/rustc_middle/src/mir/syntax.rs
+++ b/compiler/rustc_middle/src/mir/syntax.rs
@@ -395,7 +395,7 @@ pub enum StatementKind<'tcx> {
     /// `PlaceMention(PLACE)`.
     ///
     /// When executed at runtime, this computes the given place, but then discards
-    /// it without doing a load. It is UB if the place is not pointing to live memory.
+    /// it without doing a load. `let _ = *ptr;` is fine even if the pointer is dangling.
     PlaceMention(Box<Place<'tcx>>),
 
     /// Encodes a user's type ascription. These need to be preserved