Skip to content

Commit 07a7bec

Browse files
committed
Auto merge of rust-lang#104833 - Swatinem:async-identity-future, r=compiler-errors
Remove `identity_future` indirection This was previously needed because the indirection used to hide some unexplained lifetime errors, which it turned out were related to the `min_choice` algorithm. Removing the indirection also solves a couple of cycle errors, large moves and makes async blocks support the `#[track_caller]`annotation. Fixes rust-lang#104826.
2 parents c23fdf8 + cf50248 commit 07a7bec

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

core/src/future/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,10 @@ pub unsafe fn get_context<'a, 'b>(cx: ResumeTy) -> &'a mut Context<'b> {
6767
unsafe { &mut *cx.0.as_ptr().cast() }
6868
}
6969

70-
// FIXME(swatinem): This fn is currently needed to work around shortcomings
71-
// in type and lifetime inference.
72-
// See the comment at the bottom of `LoweringContext::make_async_expr` and
73-
// <https://github.com/rust-lang/rust/issues/104826>.
7470
#[doc(hidden)]
7571
#[unstable(feature = "gen_future", issue = "50547")]
7672
#[inline]
77-
#[lang = "identity_future"]
73+
#[cfg_attr(bootstrap, lang = "identity_future")]
7874
pub const fn identity_future<O, Fut: Future<Output = O>>(f: Fut) -> Fut {
7975
f
8076
}

0 commit comments

Comments
 (0)