File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
compiler/rustc_middle/src/ty Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1929,13 +1929,17 @@ impl<'tcx> TyCtxt<'tcx> {
19291929 if arg_cor_ty. is_coroutine ( ) {
19301930 let span = self . def_span ( def_id) ;
19311931 let source_info = SourceInfo :: outermost ( span) ;
1932+ // Even minimal, empty coroutine has 3 states (RESERVED_VARIANTS),
1933+ // so variant_fields and variant_source_info should have 3 elements.
19321934 let variant_fields: IndexVec < VariantIdx , IndexVec < FieldIdx , CoroutineSavedLocal > > =
19331935 iter:: repeat ( IndexVec :: new ( ) ) . take ( CoroutineArgs :: RESERVED_VARIANTS ) . collect ( ) ;
1936+ let variant_source_info: IndexVec < VariantIdx , SourceInfo > =
1937+ iter:: repeat ( source_info) . take ( CoroutineArgs :: RESERVED_VARIANTS ) . collect ( ) ;
19341938 let proxy_layout = CoroutineLayout {
19351939 field_tys : [ ] . into ( ) ,
19361940 field_names : [ ] . into ( ) ,
19371941 variant_fields,
1938- variant_source_info : [ source_info ] . into ( ) ,
1942+ variant_source_info,
19391943 storage_conflicts : BitMatrix :: new ( 0 , 0 ) ,
19401944 } ;
19411945 return Some ( self . arena . alloc ( proxy_layout) ) ;
You can’t perform that action at this time.
0 commit comments