File tree 3 files changed +16
-3
lines changed
3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -705,7 +705,6 @@ impl LoweringContext<'_> {
705
705
E0628 ,
706
706
"generators cannot have explicit parameters"
707
707
) ;
708
- self . sess . abort_if_errors ( ) ;
709
708
}
710
709
Some ( match movability {
711
710
Movability :: Movable => hir:: GeneratorMovability :: Movable ,
@@ -998,7 +997,7 @@ impl LoweringContext<'_> {
998
997
E0727 ,
999
998
"`async` generators are not yet supported" ,
1000
999
) ;
1001
- self . sess . abort_if_errors ( ) ;
1000
+ return hir :: ExprKind :: Err ;
1002
1001
} ,
1003
1002
None => self . generator_kind = Some ( hir:: GeneratorKind :: Gen ) ,
1004
1003
}
Original file line number Diff line number Diff line change 2
2
3
3
fn main ( ) {
4
4
let gen = |start| { //~ ERROR generators cannot have explicit parameters
5
+ //~^ ERROR type inside generator must be known in this context
5
6
yield ;
6
7
} ;
7
8
}
Original file line number Diff line number Diff line change @@ -4,5 +4,18 @@ error[E0628]: generators cannot have explicit parameters
4
4
LL | let gen = |start| {
5
5
| ^^^^^^^
6
6
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
8
20
21
+ For more information about this error, try `rustc --explain E0698`.
You can’t perform that action at this time.
0 commit comments