@@ -517,7 +517,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
517517
518518 /// Desugar `<expr>.await` into:
519519 /// ```rust
520- /// match ::std::future::IntoFuture::into_future( <expr>) {
520+ /// match <expr> {
521521 /// mut pinned => loop {
522522 /// match ::std::future::poll_with_tls_context(unsafe {
523523 /// <::std::pin::Pin>::new_unchecked(&mut pinned)
@@ -641,27 +641,11 @@ impl<'hir> LoweringContext<'_, 'hir> {
641641 // mut pinned => loop { ... }
642642 let pinned_arm = self . arm ( pinned_pat, loop_expr) ;
643643
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> {
658645 // mut pinned => loop { .. }
659646 // }
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 )
665649 }
666650
667651 fn lower_expr_closure (
0 commit comments