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:
parent
13471d3b20
commit
b3a47d9b6b
20 changed files with 273 additions and 157 deletions
|
@ -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",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue