@@ -66,7 +66,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
6666 seg,
6767 ParamMode :: Optional ,
6868 ParenthesizedGenericArgs :: Err ,
69- ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
69+ & mut ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
7070 ) ) ;
7171 let receiver = self . lower_expr ( receiver) ;
7272 let args =
@@ -89,14 +89,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
8989 }
9090 ExprKind :: Cast ( ref expr, ref ty) => {
9191 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 ) ) ;
9494 hir:: ExprKind :: Cast ( expr, ty)
9595 }
9696 ExprKind :: Type ( ref expr, ref ty) => {
9797 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 ) ) ;
100100 hir:: ExprKind :: Type ( expr, ty)
101101 }
102102 ExprKind :: AddrOf ( k, m, ref ohs) => {
@@ -219,7 +219,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
219219 qself,
220220 path,
221221 ParamMode :: Optional ,
222- ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
222+ & mut ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
223223 ) ;
224224 hir:: ExprKind :: Path ( qpath)
225225 }
@@ -253,7 +253,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
253253 & se. qself ,
254254 & se. path ,
255255 ParamMode :: Optional ,
256- ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
256+ & mut ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
257257 ) ) ,
258258 self . arena
259259 . alloc_from_iter ( se. fields . iter ( ) . map ( |x| self . lower_expr_field ( x) ) ) ,
@@ -550,12 +550,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
550550 async_gen_kind : hir:: AsyncGeneratorKind ,
551551 body : impl FnOnce ( & mut Self ) -> hir:: Expr < ' hir > ,
552552 ) -> 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+ } ;
559561
560562 // Resume argument type. We let the compiler infer this to simplify the lowering. It is
561563 // fully constrained by `future::from_generator`.
@@ -1123,7 +1125,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
11231125 qself,
11241126 path,
11251127 ParamMode :: Optional ,
1126- ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
1128+ & mut ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
11271129 ) ;
11281130 // Destructure like a tuple struct.
11291131 let tuple_struct_pat =
@@ -1139,7 +1141,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
11391141 qself,
11401142 path,
11411143 ParamMode :: Optional ,
1142- ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
1144+ & mut ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
11431145 ) ;
11441146 // Destructure like a unit struct.
11451147 let unit_struct_pat = hir:: PatKind :: Path ( qpath) ;
@@ -1163,7 +1165,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
11631165 & se. qself ,
11641166 & se. path ,
11651167 ParamMode :: Optional ,
1166- ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
1168+ & mut ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
11671169 ) ;
11681170 let fields_omitted = match & se. rest {
11691171 StructRest :: Base ( e) => {
0 commit comments