@@ -524,15 +524,15 @@ impl<'hir> LoweringContext<'_, 'hir> {
524524 this. mark_span_with_reason (
525525 DesugaringKind :: TryBlock ,
526526 expr. span ,
527- this. allow_try_trait . clone ( ) ,
527+ Some ( this. allow_try_trait . clone ( ) ) ,
528528 ) ,
529529 expr,
530530 )
531531 } else {
532532 let try_span = this. mark_span_with_reason (
533533 DesugaringKind :: TryBlock ,
534534 this. tcx . sess . source_map ( ) . end_point ( body. span ) ,
535- this. allow_try_trait . clone ( ) ,
535+ Some ( this. allow_try_trait . clone ( ) ) ,
536536 ) ;
537537
538538 ( try_span, this. expr_unit ( try_span) )
@@ -612,8 +612,11 @@ impl<'hir> LoweringContext<'_, 'hir> {
612612 let output = ret_ty. unwrap_or_else ( || hir:: FnRetTy :: DefaultReturn ( self . lower_span ( span) ) ) ;
613613
614614 // Resume argument type: `ResumeTy`
615- let unstable_span =
616- self . mark_span_with_reason ( DesugaringKind :: Async , span, self . allow_gen_future . clone ( ) ) ;
615+ let unstable_span = self . mark_span_with_reason (
616+ DesugaringKind :: Async ,
617+ span,
618+ Some ( self . allow_gen_future . clone ( ) ) ,
619+ ) ;
617620 let resume_ty = hir:: QPath :: LangItem ( hir:: LangItem :: ResumeTy , unstable_span) ;
618621 let input_ty = hir:: Ty {
619622 hir_id : self . next_id ( ) ,
@@ -735,7 +738,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
735738 let unstable_span = self . mark_span_with_reason (
736739 DesugaringKind :: Async ,
737740 span,
738- self . allow_gen_future . clone ( ) ,
741+ Some ( self . allow_gen_future . clone ( ) ) ,
739742 ) ;
740743 self . lower_attrs (
741744 inner_hir_id,
@@ -782,7 +785,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
782785 let gen_future_span = self . mark_span_with_reason (
783786 DesugaringKind :: Await ,
784787 full_span,
785- self . allow_gen_future . clone ( ) ,
788+ Some ( self . allow_gen_future . clone ( ) ) ,
786789 ) ;
787790 let expr = self . lower_expr_mut ( expr) ;
788791 let expr_hir_id = expr. hir_id ;
@@ -1640,13 +1643,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
16401643 let unstable_span = self . mark_span_with_reason (
16411644 DesugaringKind :: QuestionMark ,
16421645 span,
1643- self . allow_try_trait . clone ( ) ,
1646+ Some ( self . allow_try_trait . clone ( ) ) ,
16441647 ) ;
16451648 let try_span = self . tcx . sess . source_map ( ) . end_point ( span) ;
16461649 let try_span = self . mark_span_with_reason (
16471650 DesugaringKind :: QuestionMark ,
16481651 try_span,
1649- self . allow_try_trait . clone ( ) ,
1652+ Some ( self . allow_try_trait . clone ( ) ) ,
16501653 ) ;
16511654
16521655 // `Try::branch(<expr>)`
@@ -1739,7 +1742,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
17391742 let unstable_span = self . mark_span_with_reason (
17401743 DesugaringKind :: YeetExpr ,
17411744 span,
1742- self . allow_try_trait . clone ( ) ,
1745+ Some ( self . allow_try_trait . clone ( ) ) ,
17431746 ) ;
17441747
17451748 let from_yeet_expr = self . wrap_in_try_constructor (
0 commit comments