1
Fork 0

Desugars drop and replace at MIR build

This commit desugars the drop and replace deriving from an
assignment at MIR build, avoiding the construction of the
DropAndReplace terminator (which will be removed in a followign PR)

In order to retain the same error messages for replaces a new
DesugaringKind::Replace variant is introduced.
This commit is contained in:
Giacomo Pasini 2023-02-08 22:29:52 +01:00
parent 13471d3b20
commit b3a47d9b6b
No known key found for this signature in database
GPG key ID: A03851B78A6C9A46
20 changed files with 273 additions and 157 deletions

View file

@ -1151,6 +1151,7 @@ pub enum DesugaringKind {
Await,
ForLoop,
WhileLoop,
Replace,
}
impl DesugaringKind {
@ -1166,6 +1167,7 @@ impl DesugaringKind {
DesugaringKind::OpaqueTy => "`impl Trait`",
DesugaringKind::ForLoop => "`for` loop",
DesugaringKind::WhileLoop => "`while` loop",
DesugaringKind::Replace => "drop and replace",
}
}
}