]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir_build/build/expr/as_rvalue.rs
Change MIR building to fill in the resume place
[rust.git] / src / librustc_mir_build / build / expr / as_rvalue.rs
index 16795b459b6bd5dbbb87629e7fca282c780750fd..6f5c5f0dd4c5013b795c7cdd4eea0457235930ec 100644 (file)
@@ -230,18 +230,8 @@ fn expr_as_rvalue(
                 block = unpack!(this.stmt_expr(block, expr, None));
                 block.and(this.unit_rvalue())
             }
-            ExprKind::Yield { value } => {
-                let value = unpack!(block = this.as_operand(block, scope, value));
-                let resume = this.cfg.start_new_block();
-                let cleanup = this.generator_drop_cleanup();
-                this.cfg.terminate(
-                    block,
-                    source_info,
-                    TerminatorKind::Yield { value: value, resume: resume, drop: cleanup },
-                );
-                resume.and(this.unit_rvalue())
-            }
-            ExprKind::Literal { .. }
+            ExprKind::Yield { .. }
+            | ExprKind::Literal { .. }
             | ExprKind::StaticRef { .. }
             | ExprKind::Block { .. }
             | ExprKind::Match { .. }