Introduce a no-op PlaceMention statement for let _ =
.
This commit is contained in:
parent
be758ef5ab
commit
4462bb54e3
44 changed files with 139 additions and 20 deletions
|
@ -325,6 +325,15 @@ pub enum StatementKind<'tcx> {
|
|||
/// Only `RetagKind::Default` and `RetagKind::FnEntry` are permitted.
|
||||
Retag(RetagKind, Box<Place<'tcx>>),
|
||||
|
||||
/// This statement exists to preserve a trace of a scrutinee matched against a wildcard
|
||||
/// binding. This is especially useful for `let _ = PLACE;` bindings that desugar to a single
|
||||
/// `PlaceMention(PLACE)`.
|
||||
///
|
||||
/// When executed at runtime this is a nop.
|
||||
///
|
||||
/// Disallowed after drop elaboration.
|
||||
PlaceMention(Box<Place<'tcx>>),
|
||||
|
||||
/// Encodes a user's type ascription. These need to be preserved
|
||||
/// intact so that NLL can respect them. For example:
|
||||
/// ```ignore (illustrative)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue