File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
rustc_const_eval/src/transform Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -105,14 +105,16 @@ impl<'tcx> MirPass<'tcx> for Validator {
105105 && let Some ( by_move_body) = body. coroutine_by_move_body ( )
106106 && let Some ( by_move_layout) = by_move_body. coroutine_layout_raw ( )
107107 {
108- if layout != by_move_layout {
108+ // FIXME(async_closures): We could do other validation here?
109+ if layout. variant_fields . len ( ) != by_move_layout. variant_fields . len ( ) {
109110 // If this turns out not to be true, please let compiler-errors know.
110111 // It is possible to support, but requires some changes to the layout
111112 // computation code.
112113 cfg_checker. fail (
113114 Location :: START ,
114115 format ! (
115- "Coroutine layout differs from by-move coroutine layout:\n \
116+ "Coroutine layout has different number of variant fields from \
117+ by-move coroutine layout:\n \
116118 layout: {layout:#?}\n \
117119 by_move_layout: {by_move_layout:#?}",
118120 ) ,
Original file line number Diff line number Diff line change @@ -694,8 +694,6 @@ impl<'tcx> CoroutineArgs<'tcx> {
694694 #[ inline]
695695 pub fn variant_range ( & self , def_id : DefId , tcx : TyCtxt < ' tcx > ) -> Range < VariantIdx > {
696696 // FIXME requires optimized MIR
697- // FIXME(async_closures): We should assert all coroutine layouts have
698- // the same number of variants.
699697 FIRST_VARIANT
700698 ..tcx. coroutine_layout ( def_id, tcx. types . unit ) . unwrap ( ) . variant_fields . next_index ( )
701699 }
You can’t perform that action at this time.
0 commit comments