File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
2+ // skip-filecheck
3+ //@ unit-test: Inline
4+ //@ edition: 2021
5+ //@ compile-flags: -Zinline-mir-hint-threshold=10000 -Zinline-mir-threshold=10000 --crate-type=lib
6+
7+ pub async fn run ( permit : ActionPermit < ' _ , ( ) > , ctx : & mut core:: task:: Context < ' _ > ) {
8+ run2 ( permit, ctx) ;
9+ }
10+
11+ // EMIT_MIR inline_coroutine_body.run2.Inline.diff
12+ fn run2 < T > ( permit : ActionPermit < ' _ , T > , ctx : & mut core:: task:: Context ) {
13+ _ = || {
14+ let mut fut = ActionPermit :: perform ( permit) ;
15+ let fut = unsafe { core:: pin:: Pin :: new_unchecked ( & mut fut) } ;
16+ _ = core:: future:: Future :: poll ( fut, ctx) ;
17+ } ;
18+ }
19+
20+ pub struct ActionPermit < ' a , T > {
21+ _guard : core:: cell:: Ref < ' a , T > ,
22+ }
23+
24+ impl < ' a , T > ActionPermit < ' a , T > {
25+ async fn perform ( self ) {
26+ core:: future:: ready ( ( ) ) . await
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments