-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
200e3f7
commit 0cf798e
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY | ||
// skip-filecheck | ||
//@ unit-test: Inline | ||
//@ edition: 2021 | ||
//@ compile-flags: -Zinline-mir-hint-threshold=10000 -Zinline-mir-threshold=10000 --crate-type=lib | ||
|
||
pub async fn run(permit: ActionPermit<'_, ()>, ctx: &mut core::task::Context<'_>) { | ||
run2(permit, ctx); | ||
} | ||
|
||
// EMIT_MIR inline_coroutine_body.run2.Inline.diff | ||
fn run2<T>(permit: ActionPermit<'_, T>, ctx: &mut core::task::Context) { | ||
_ = || { | ||
let mut fut = ActionPermit::perform(permit); | ||
let fut = unsafe { core::pin::Pin::new_unchecked(&mut fut) }; | ||
_ = core::future::Future::poll(fut, ctx); | ||
}; | ||
} | ||
|
||
pub struct ActionPermit<'a, T> { | ||
_guard: core::cell::Ref<'a, T>, | ||
} | ||
|
||
impl<'a, T> ActionPermit<'a, T> { | ||
async fn perform(self) { | ||
core::future::ready(()).await | ||
} | ||
} |