Skip to content

Commit

Permalink
Rollup merge of #96400 - JakobDegen:shallow-init-docs, r=Dylan-DPC
Browse files Browse the repository at this point in the history
Correct documentation for `Rvalue::ShallowInitBox`

As a part of the big MIR docs PR, I had added a comment indicating that `Rvalue::ShallowInitBox` is disallowed after drop elaboration, but this is not true (no idea why I thought it was). Codegen has support for it, and trying to enforce this rule in the validator causes compiling core to ICE on the very first `box` statement.

That being said, this `Rvalue` probably *should* be banned after drop elaboration - it doesn't seem like it's still useful for much. However, I do not have time right now to actually go investigate how difficult a change that is to make, so in the meantime fixing the docs to reflect the current situation seems like the right step.

r? rust-lang/mir-opt
  • Loading branch information
GuillaumeGomez authored Apr 26, 2022
2 parents a818173 + 941e194 commit f908391
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions compiler/rustc_middle/src/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2581,8 +2581,6 @@ pub enum Rvalue<'tcx> {
/// This is different from a normal transmute because dataflow analysis will treat the box as
/// initialized but its content as uninitialized. Like other pointer casts, this in general
/// affects alias analysis.
///
/// Disallowed after drop elaboration.
ShallowInitBox(Operand<'tcx>, Ty<'tcx>),
}

Expand Down

0 comments on commit f908391

Please sign in to comment.