@@ -524,15 +524,15 @@ impl<'hir> LoweringContext<'_, 'hir> {
524
524
this. mark_span_with_reason (
525
525
DesugaringKind :: TryBlock ,
526
526
expr. span ,
527
- this. allow_try_trait . clone ( ) ,
527
+ Some ( this. allow_try_trait . clone ( ) ) ,
528
528
) ,
529
529
expr,
530
530
)
531
531
} else {
532
532
let try_span = this. mark_span_with_reason (
533
533
DesugaringKind :: TryBlock ,
534
534
this. tcx . sess . source_map ( ) . end_point ( body. span ) ,
535
- this. allow_try_trait . clone ( ) ,
535
+ Some ( this. allow_try_trait . clone ( ) ) ,
536
536
) ;
537
537
538
538
( try_span, this. expr_unit ( try_span) )
@@ -612,8 +612,11 @@ impl<'hir> LoweringContext<'_, 'hir> {
612
612
let output = ret_ty. unwrap_or_else ( || hir:: FnRetTy :: DefaultReturn ( self . lower_span ( span) ) ) ;
613
613
614
614
// 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
+ ) ;
617
620
let resume_ty = hir:: QPath :: LangItem ( hir:: LangItem :: ResumeTy , unstable_span) ;
618
621
let input_ty = hir:: Ty {
619
622
hir_id : self . next_id ( ) ,
@@ -735,7 +738,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
735
738
let unstable_span = self . mark_span_with_reason (
736
739
DesugaringKind :: Async ,
737
740
span,
738
- self . allow_gen_future . clone ( ) ,
741
+ Some ( self . allow_gen_future . clone ( ) ) ,
739
742
) ;
740
743
self . lower_attrs (
741
744
inner_hir_id,
@@ -782,7 +785,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
782
785
let gen_future_span = self . mark_span_with_reason (
783
786
DesugaringKind :: Await ,
784
787
full_span,
785
- self . allow_gen_future . clone ( ) ,
788
+ Some ( self . allow_gen_future . clone ( ) ) ,
786
789
) ;
787
790
let expr = self . lower_expr_mut ( expr) ;
788
791
let expr_hir_id = expr. hir_id ;
@@ -1640,13 +1643,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
1640
1643
let unstable_span = self . mark_span_with_reason (
1641
1644
DesugaringKind :: QuestionMark ,
1642
1645
span,
1643
- self . allow_try_trait . clone ( ) ,
1646
+ Some ( self . allow_try_trait . clone ( ) ) ,
1644
1647
) ;
1645
1648
let try_span = self . tcx . sess . source_map ( ) . end_point ( span) ;
1646
1649
let try_span = self . mark_span_with_reason (
1647
1650
DesugaringKind :: QuestionMark ,
1648
1651
try_span,
1649
- self . allow_try_trait . clone ( ) ,
1652
+ Some ( self . allow_try_trait . clone ( ) ) ,
1650
1653
) ;
1651
1654
1652
1655
// `Try::branch(<expr>)`
@@ -1739,7 +1742,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
1739
1742
let unstable_span = self . mark_span_with_reason (
1740
1743
DesugaringKind :: YeetExpr ,
1741
1744
span,
1742
- self . allow_try_trait . clone ( ) ,
1745
+ Some ( self . allow_try_trait . clone ( ) ) ,
1743
1746
) ;
1744
1747
1745
1748
let from_yeet_expr = self . wrap_in_try_constructor (
0 commit comments