@@ -66,7 +66,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
66
66
seg,
67
67
ParamMode :: Optional ,
68
68
ParenthesizedGenericArgs :: Err ,
69
- ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
69
+ & mut ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
70
70
) ) ;
71
71
let receiver = self . lower_expr ( receiver) ;
72
72
let args =
@@ -89,14 +89,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
89
89
}
90
90
ExprKind :: Cast ( ref expr, ref ty) => {
91
91
let expr = self . lower_expr ( expr) ;
92
- let ty =
93
- self . lower_ty ( ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) ) ;
92
+ let ty = self
93
+ . lower_ty ( ty, & mut ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) ) ;
94
94
hir:: ExprKind :: Cast ( expr, ty)
95
95
}
96
96
ExprKind :: Type ( ref expr, ref ty) => {
97
97
let expr = self . lower_expr ( expr) ;
98
- let ty =
99
- self . lower_ty ( ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) ) ;
98
+ let ty = self
99
+ . lower_ty ( ty, & mut ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) ) ;
100
100
hir:: ExprKind :: Type ( expr, ty)
101
101
}
102
102
ExprKind :: AddrOf ( k, m, ref ohs) => {
@@ -219,7 +219,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
219
219
qself,
220
220
path,
221
221
ParamMode :: Optional ,
222
- ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
222
+ & mut ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
223
223
) ;
224
224
hir:: ExprKind :: Path ( qpath)
225
225
}
@@ -253,7 +253,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
253
253
& se. qself ,
254
254
& se. path ,
255
255
ParamMode :: Optional ,
256
- ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
256
+ & mut ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
257
257
) ) ,
258
258
self . arena
259
259
. alloc_from_iter ( se. fields . iter ( ) . map ( |x| self . lower_expr_field ( x) ) ) ,
@@ -550,12 +550,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
550
550
async_gen_kind : hir:: AsyncGeneratorKind ,
551
551
body : impl FnOnce ( & mut Self ) -> hir:: Expr < ' hir > ,
552
552
) -> hir:: ExprKind < ' hir > {
553
- let output = match ret_ty {
554
- Some ( ty) => hir:: FnRetTy :: Return (
555
- self . lower_ty ( & ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: AsyncBlock ) ) ,
556
- ) ,
557
- None => hir:: FnRetTy :: DefaultReturn ( self . lower_span ( span) ) ,
558
- } ;
553
+ let output =
554
+ match ret_ty {
555
+ Some ( ty) => hir:: FnRetTy :: Return ( self . lower_ty (
556
+ & ty,
557
+ & mut ImplTraitContext :: Disallowed ( ImplTraitPosition :: AsyncBlock ) ,
558
+ ) ) ,
559
+ None => hir:: FnRetTy :: DefaultReturn ( self . lower_span ( span) ) ,
560
+ } ;
559
561
560
562
// Resume argument type. We let the compiler infer this to simplify the lowering. It is
561
563
// fully constrained by `future::from_generator`.
@@ -1123,7 +1125,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
1123
1125
qself,
1124
1126
path,
1125
1127
ParamMode :: Optional ,
1126
- ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
1128
+ & mut ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
1127
1129
) ;
1128
1130
// Destructure like a tuple struct.
1129
1131
let tuple_struct_pat =
@@ -1139,7 +1141,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
1139
1141
qself,
1140
1142
path,
1141
1143
ParamMode :: Optional ,
1142
- ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
1144
+ & mut ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
1143
1145
) ;
1144
1146
// Destructure like a unit struct.
1145
1147
let unit_struct_pat = hir:: PatKind :: Path ( qpath) ;
@@ -1163,7 +1165,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
1163
1165
& se. qself ,
1164
1166
& se. path ,
1165
1167
ParamMode :: Optional ,
1166
- ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
1168
+ & mut ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
1167
1169
) ;
1168
1170
let fields_omitted = match & se. rest {
1169
1171
StructRest :: Base ( e) => {
0 commit comments