diff options
| author | Giacomo Pasini <giacomo@status.im> | 2023-02-08 22:29:52 +0100 |
|---|---|---|
| committer | Giacomo Pasini <giacomo@status.im> | 2023-03-03 16:33:11 +0100 |
| commit | b3a47d9b6b26adebe9ce0e24c7efb26c6380d50a (patch) | |
| tree | ac5e0d9d46bc053d00fe99b787af4480d0bbf1f6 /compiler/rustc_span/src | |
| parent | 13471d3b2046cce78181dde6cfc146c09f55e29e (diff) | |
| download | rust-b3a47d9b6b26adebe9ce0e24c7efb26c6380d50a.tar.gz rust-b3a47d9b6b26adebe9ce0e24c7efb26c6380d50a.zip | |
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.
Diffstat (limited to 'compiler/rustc_span/src')
| -rw-r--r-- | compiler/rustc_span/src/hygiene.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/hygiene.rs b/compiler/rustc_span/src/hygiene.rs index dee823eefde..9f22e9776d4 100644 --- a/compiler/rustc_span/src/hygiene.rs +++ b/compiler/rustc_span/src/hygiene.rs @@ -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", } } } |
