Allow 0 or 1 explicit generator parameters
This commit is contained in:
parent
8a1227a67b
commit
32005fe195
1 changed files with 2 additions and 2 deletions
|
@ -688,12 +688,12 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
||||||
) -> Option<hir::Movability> {
|
) -> Option<hir::Movability> {
|
||||||
match generator_kind {
|
match generator_kind {
|
||||||
Some(hir::GeneratorKind::Gen) => {
|
Some(hir::GeneratorKind::Gen) => {
|
||||||
if !decl.inputs.is_empty() {
|
if decl.inputs.len() > 1 {
|
||||||
struct_span_err!(
|
struct_span_err!(
|
||||||
self.sess,
|
self.sess,
|
||||||
fn_decl_span,
|
fn_decl_span,
|
||||||
E0628,
|
E0628,
|
||||||
"generators cannot have explicit parameters"
|
"too many parameters for generator (expected 0 or 1 parameters)"
|
||||||
)
|
)
|
||||||
.emit();
|
.emit();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue