@@ -197,8 +197,10 @@ impl<'hir> LoweringContext<'_, 'hir> {
197197 id,
198198 ImplTraitContext :: Disallowed ( ImplTraitPosition :: Generic ) ,
199199 |this| {
200- let ty = this
201- . lower_ty ( ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: ConstTy ) ) ;
200+ let ty = this. lower_fn_ret_ty_or_unit (
201+ ty,
202+ ImplTraitContext :: Disallowed ( ImplTraitPosition :: ConstTy ) ,
203+ ) ;
202204 let rhs = this. lower_const_item_rhs ( attrs, rhs. as_ref ( ) , span) ;
203205 ( ty, rhs)
204206 } ,
@@ -817,8 +819,10 @@ impl<'hir> LoweringContext<'_, 'hir> {
817819 i. id ,
818820 ImplTraitContext :: Disallowed ( ImplTraitPosition :: Generic ) ,
819821 |this| {
820- let ty = this
821- . lower_ty ( ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: ConstTy ) ) ;
822+ let ty = this. lower_fn_ret_ty_or_unit (
823+ ty,
824+ ImplTraitContext :: Disallowed ( ImplTraitPosition :: ConstTy ) ,
825+ ) ;
822826 let rhs = rhs
823827 . as_ref ( )
824828 . map ( |rhs| this. lower_const_item_rhs ( attrs, Some ( rhs) , i. span ) ) ;
@@ -1029,8 +1033,10 @@ impl<'hir> LoweringContext<'_, 'hir> {
10291033 i. id ,
10301034 ImplTraitContext :: Disallowed ( ImplTraitPosition :: Generic ) ,
10311035 |this| {
1032- let ty = this
1033- . lower_ty ( ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: ConstTy ) ) ;
1036+ let ty = this. lower_fn_ret_ty_or_unit (
1037+ ty,
1038+ ImplTraitContext :: Disallowed ( ImplTraitPosition :: ConstTy ) ,
1039+ ) ;
10341040 this. lower_define_opaque ( hir_id, & define_opaque) ;
10351041 let rhs = this. lower_const_item_rhs ( attrs, rhs. as_ref ( ) , i. span ) ;
10361042 hir:: ImplItemKind :: Const ( ty, rhs)
0 commit comments