mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-17 01:13:11 +00:00
Rollup merge of #109408 - RalfJung:retags, r=compiler-errors
not *all* retags might be explicit in Runtime MIR In https://github.com/rust-lang/rust/pull/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.
This commit is contained in:
commit
925fbcdf8a
@ -78,7 +78,8 @@ pub enum MirPhase {
|
||||
/// MIR, this is UB.
|
||||
/// - Retags: If `-Zmir-emit-retag` is enabled, analysis MIR has "implicit" retags in the same way
|
||||
/// that Rust itself has them. Where exactly these are is generally subject to change, and so we
|
||||
/// don't document this here. Runtime MIR has all retags explicit.
|
||||
/// don't document this here. Runtime MIR has most retags explicit (though implicit retags
|
||||
/// can still occur at `Rvalue::{Ref,AddrOf}`).
|
||||
/// - Generator bodies: In analysis MIR, locals may actually be behind a pointer that user code has
|
||||
/// access to. This occurs in generator bodies. Such locals do not behave like other locals,
|
||||
/// because they eg may be aliased in surprising ways. Runtime MIR has no such special locals -
|
||||
|
Loading…
Reference in New Issue
Block a user