File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
compiler/rustc_mir_transform/src
tests/ui/async-await/async-drop Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -317,6 +317,23 @@ impl<'tcx> TransformVisitor<'tcx> {
317
317
),
318
318
user_ty: None,
319
319
})))
320
+ } else if matches!(
321
+ val,
322
+ Operand::Constant(box ConstOperand {
323
+ const_: Const::Val(ConstValue::Scalar(_), _),
324
+ ..
325
+ })
326
+ ) {
327
+ // yield (const false) is used for async drop yields inside AsyncGen
328
+ // We need to convert value to Poll<OptRet>::Pending
329
+ let poll_def_id = self.tcx.require_lang_item(LangItem::Poll, None);
330
+ let ty::Adt(_poll_adt, args) = *self.old_yield_ty.kind() else { bug!() };
331
+ make_aggregate_adt(
332
+ poll_def_id,
333
+ VariantIdx::from_usize(1),
334
+ args,
335
+ IndexVec::new(),
336
+ )
320
337
} else {
321
338
Rvalue::Use(val)
322
339
}
Original file line number Diff line number Diff line change 1
- //@ known-bug : #140530
1
+ // ex-ice : #140530
2
2
//@ edition: 2024
3
-
3
+ //@ build-pass
4
4
#![ feature( async_drop, gen_blocks) ]
5
+ #![ allow( incomplete_features) ]
5
6
async gen fn a ( ) {
6
7
_ = async { }
7
8
}
You can’t perform that action at this time.
0 commit comments