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