Skip to content

Commit 925fbcd

Browse files
authored
Rollup merge of #109408 - RalfJung:retags, r=compiler-errors
not *all* retags might be explicit in Runtime MIR In #105317 I made Miri treat `Rvalue::Ref/AddrOf` as implicit retagging sites. This updates the MIR docs accordingly. For `Rvalue::Ref` I think this makes a lot more sense: creating a new reference is their entire point, so we can avoid bloating the MIR with retags. Also this seems to be the best way to handle cases like `*ptr = &[mut] ...`, where doing a retag is somewhat questionable since maybe `*ptr` points to another place now? For `Rvalue::AddrOf`, Stacked Borrows needs this because even raw ptrs need some retagging, but Tree Borrows doesn't do ant retagging here and I hope we'll end up with a model where raw pointers don't get retagged.
2 parents b2e48ed + 5058cc8 commit 925fbcd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/rustc_middle/src/mir/syntax.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ pub enum MirPhase {
7878
/// MIR, this is UB.
7979
/// - Retags: If `-Zmir-emit-retag` is enabled, analysis MIR has "implicit" retags in the same way
8080
/// that Rust itself has them. Where exactly these are is generally subject to change, and so we
81-
/// don't document this here. Runtime MIR has all retags explicit.
81+
/// don't document this here. Runtime MIR has most retags explicit (though implicit retags
82+
/// can still occur at `Rvalue::{Ref,AddrOf}`).
8283
/// - Generator bodies: In analysis MIR, locals may actually be behind a pointer that user code has
8384
/// access to. This occurs in generator bodies. Such locals do not behave like other locals,
8485
/// because they eg may be aliased in surprising ways. Runtime MIR has no such special locals -

0 commit comments

Comments
 (0)