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 @@ -705,7 +705,6 @@ impl LoweringContext<'_> {
705705 E0628 ,
706706 "generators cannot have explicit parameters"
707707 ) ;
708- self . sess . abort_if_errors ( ) ;
709708 }
710709 Some ( match movability {
711710 Movability :: Movable => hir:: GeneratorMovability :: Movable ,
@@ -998,7 +997,7 @@ impl LoweringContext<'_> {
998997 E0727 ,
999998 "`async` generators are not yet supported" ,
1000999 ) ;
1001- self . sess . abort_if_errors ( ) ;
1000+ return hir :: ExprKind :: Err ;
10021001 } ,
10031002 None => self . generator_kind = Some ( hir:: GeneratorKind :: Gen ) ,
10041003 }
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