about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc/hir/lowering.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs
index 8b092ff727e..50c8763600f 100644
--- a/src/librustc/hir/lowering.rs
+++ b/src/librustc/hir/lowering.rs
@@ -1958,6 +1958,11 @@ impl<'a> LoweringContext<'a> {
                             gen = this.impl_arg.map(|_| hir::GeneratorClause::Movable);
                             e
                         });
+                        if gen.is_some() && !decl.inputs.is_empty() {
+                            this.sess.span_fatal(
+                                    fn_decl_span,
+                                    &format!("generators cannot have explicit arguments"));
+                        }
                         hir::ExprClosure(this.lower_capture_clause(capture_clause),
                                          this.lower_fn_decl(decl),
                                          body_id,