about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-08-21 18:15:06 +0200
committerGitHub <noreply@github.com>2024-08-21 18:15:06 +0200
commit9fd2832a7ee414c8baf8ab1d3963443cd9b9fff3 (patch)
treecdb3668b09860967f31162df4cb1c915fc62ccb8 /compiler
parent4137f3bc15d25a9a21f809274dc29c13462d97a3 (diff)
parent9010708d9f5dc7e3377acc116a64573fadc7ed2b (diff)
downloadrust-9fd2832a7ee414c8baf8ab1d3963443cd9b9fff3.tar.gz
rust-9fd2832a7ee414c8baf8ab1d3963443cd9b9fff3.zip
Rollup merge of #129355 - RalfJung:PlaceMention, r=compiler-errors
fix comment on PlaceMention semantics

It seems this was simply missed in https://github.com/rust-lang/rust/pull/114330.
Diffstat (limited to 'compiler')
-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