diff options
| author | Jakob Degen <jakob.e.degen@gmail.com> | 2022-04-05 17:22:31 -0400 |
|---|---|---|
| committer | Jakob Degen <jakob.e.degen@gmail.com> | 2022-04-11 08:55:03 -0400 |
| commit | 4cbe13adabc172f2f4bc40ca7590804d1378a22d (patch) | |
| tree | 352ea72e44894854e55ce88b6966a92f0811120f | |
| parent | 9b6b1a625b24d7f52647998b496de10b9fd05bf4 (diff) | |
| download | rust-4cbe13adabc172f2f4bc40ca7590804d1378a22d.tar.gz rust-4cbe13adabc172f2f4bc40ca7590804d1378a22d.zip | |
Document semantics of `Deinit` and `SetDiscriminant` MIR statements
| -rw-r--r-- | compiler/rustc_middle/src/mir/mod.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index 3832025f038..578fcd82ad6 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -1588,8 +1588,15 @@ pub enum StatementKind<'tcx> { FakeRead(Box<(FakeReadCause, Place<'tcx>)>), /// Write the discriminant for a variant to the enum Place. + /// + /// This is permitted for both generators and ADTs. This does not necessarily write to the + /// entire place; instead, it writes to the minimum set of bytes as required by the layout for + /// the type. SetDiscriminant { place: Box<Place<'tcx>>, variant_index: VariantIdx }, + /// Deinitializes the place. + /// + /// This writes `uninit` bytes to the entire place. Deinit(Box<Place<'tcx>>), /// Start a live range for the storage of the local. |
