@@ -517,7 +517,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
517
517
518
518
/// Desugar `<expr>.await` into:
519
519
/// ```rust
520
- /// match ::std::future::IntoFuture::into_future( <expr>) {
520
+ /// match <expr> {
521
521
/// mut pinned => loop {
522
522
/// match ::std::future::poll_with_tls_context(unsafe {
523
523
/// <::std::pin::Pin>::new_unchecked(&mut pinned)
@@ -641,27 +641,11 @@ impl<'hir> LoweringContext<'_, 'hir> {
641
641
// mut pinned => loop { ... }
642
642
let pinned_arm = self . arm ( pinned_pat, loop_expr) ;
643
643
644
- // `match ::std::future::IntoFuture::into_future(<expr>) { ... }`
645
- let into_future_span = self . mark_span_with_reason (
646
- DesugaringKind :: Await ,
647
- await_span,
648
- self . allow_into_future . clone ( ) ,
649
- ) ;
650
- let expr = self . lower_expr_mut ( expr) ;
651
- let into_future_expr = self . expr_call_std_path (
652
- into_future_span,
653
- & [ sym:: future, sym:: IntoFuture , sym:: into_future] ,
654
- arena_vec ! [ self ; expr] ,
655
- ) ;
656
-
657
- // match <into_future_expr> {
644
+ // match <expr> {
658
645
// mut pinned => loop { .. }
659
646
// }
660
- hir:: ExprKind :: Match (
661
- into_future_expr,
662
- arena_vec ! [ self ; pinned_arm] ,
663
- hir:: MatchSource :: AwaitDesugar ,
664
- )
647
+ let expr = self . lower_expr ( expr) ;
648
+ hir:: ExprKind :: Match ( expr, arena_vec ! [ self ; pinned_arm] , hir:: MatchSource :: AwaitDesugar )
665
649
}
666
650
667
651
fn lower_expr_closure (
0 commit comments