diff --git a/src/librustc_ast_lowering/expr.rs b/src/librustc_ast_lowering/expr.rs index 0c4cfa1f650..dd3316979f6 100644 --- a/src/librustc_ast_lowering/expr.rs +++ b/src/librustc_ast_lowering/expr.rs @@ -693,7 +693,7 @@ impl<'hir> LoweringContext<'_, 'hir> { self.sess, fn_decl_span, E0628, - "too many parameters for generator (expected 0 or 1 parameters)" + "too many parameters for a generator (expected 0 or 1 parameters)" ) .emit(); } diff --git a/src/test/ui/generator/too-many-parameters.rs b/src/test/ui/generator/too-many-parameters.rs index a0a27d90682..7a353ea298b 100644 --- a/src/test/ui/generator/too-many-parameters.rs +++ b/src/test/ui/generator/too-many-parameters.rs @@ -1,7 +1,8 @@ #![feature(generators)] fn main() { - |(), ()| { //~ error: too many parameters for generator + |(), ()| { + //~^ error: too many parameters for a generator yield; }; } diff --git a/src/test/ui/generator/too-many-parameters.stderr b/src/test/ui/generator/too-many-parameters.stderr index 0dbe5f3f6fd..a297ee43de9 100644 --- a/src/test/ui/generator/too-many-parameters.stderr +++ b/src/test/ui/generator/too-many-parameters.stderr @@ -1,4 +1,4 @@ -error[E0628]: too many parameters for generator (expected 0 or 1 parameters) +error[E0628]: too many parameters for a generator (expected 0 or 1 parameters) --> $DIR/too-many-parameters.rs:4:5 | LL | |(), ()| {