File tree Expand file tree Collapse file tree 3 files changed +22
-4
lines changed
compiler/rustc_hir_typeck/src/generator_interior
src/test/ui/lint/must_not_suspend Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -607,10 +607,7 @@ fn check_must_not_suspend_ty<'tcx>(
607
607
ty:: Tuple ( fields) => {
608
608
let mut has_emitted = false ;
609
609
let comps = match data. expr . map ( |e| & e. kind ) {
610
- Some ( hir:: ExprKind :: Tup ( comps) ) => {
611
- debug_assert_eq ! ( comps. len( ) , fields. len( ) ) ;
612
- Some ( comps)
613
- }
610
+ Some ( hir:: ExprKind :: Tup ( comps) ) if comps. len ( ) == fields. len ( ) => Some ( comps) ,
614
611
_ => None ,
615
612
} ;
616
613
for ( i, ty) in fields. iter ( ) . enumerate ( ) {
Original file line number Diff line number Diff line change
1
+ #![ feature( generators) ]
2
+
3
+ fn main ( ) {
4
+ let _generator = || {
5
+ yield ( ( ) , ( ( ) , ( ) ) ) ;
6
+ yield ( ( ) , ( ) ) ;
7
+ //~^ ERROR mismatched types
8
+ } ;
9
+ }
Original file line number Diff line number Diff line change
1
+ error[E0308]: mismatched types
2
+ --> $DIR/tuple-mismatch.rs:6:20
3
+ |
4
+ LL | yield ((), ());
5
+ | ^^ expected tuple, found `()`
6
+ |
7
+ = note: expected tuple `((), ())`
8
+ found unit type `()`
9
+
10
+ error: aborting due to previous error
11
+
12
+ For more information about this error, try `rustc --explain E0308`.
You can’t perform that action at this time.
0 commit comments