File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -704,7 +704,6 @@ impl LoweringContext<'_> {
704704 E0628 ,
705705 "generators cannot have explicit parameters"
706706 ) ;
707- self . sess . abort_if_errors ( ) ;
708707 }
709708 Some ( match movability {
710709 Movability :: Movable => hir:: GeneratorMovability :: Movable ,
@@ -996,7 +995,7 @@ impl LoweringContext<'_> {
996995 E0727 ,
997996 "`async` generators are not yet supported" ,
998997 ) ;
999- self . sess . abort_if_errors ( ) ;
998+ return hir :: ExprKind :: Err ;
1000999 } ,
10011000 None => self . generator_kind = Some ( hir:: GeneratorKind :: Gen ) ,
10021001 }
Original file line number Diff line number Diff line change 22
33fn main ( ) {
44 let gen = |start| { //~ ERROR generators cannot have explicit parameters
5+ //~^ ERROR type inside generator must be known in this context
56 yield ;
67 } ;
78}
Original file line number Diff line number Diff line change @@ -4,5 +4,18 @@ error[E0628]: generators cannot have explicit parameters
44LL | let gen = |start| {
55 | ^^^^^^^
66
7- error: aborting due to previous error
7+ error[E0698]: type inside generator must be known in this context
8+ --> $DIR/no-parameters-on-generators.rs:4:16
9+ |
10+ LL | let gen = |start| {
11+ | ^^^^^ cannot infer type
12+ |
13+ note: the type is part of the generator because of this `yield`
14+ --> $DIR/no-parameters-on-generators.rs:6:9
15+ |
16+ LL | yield;
17+ | ^^^^^
18+
19+ error: aborting due to 2 previous errors
820
21+ For more information about this error, try `rustc --explain E0698`.
You can’t perform that action at this time.
0 commit comments