@@ -270,7 +270,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
270270 ident,
271271 generics,
272272 ty,
273- rhs_kind,
273+ body,
274+ kind,
274275 define_opaque,
275276 } ) => {
276277 let ident = self . lower_ident ( * ident) ;
@@ -282,7 +283,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
282283 ty,
283284 ImplTraitContext :: Disallowed ( ImplTraitPosition :: ConstTy ) ,
284285 ) ;
285- let rhs = this. lower_const_item_rhs ( rhs_kind , span) ;
286+ let rhs = this. lower_const_item_rhs ( body , * kind , span) ;
286287 ( ty, rhs)
287288 } ,
288289 ) ;
@@ -918,7 +919,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
918919 ident,
919920 generics,
920921 ty,
921- rhs_kind,
922+ body,
923+ kind,
922924 define_opaque,
923925 ..
924926 } ) => {
@@ -931,8 +933,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
931933 ImplTraitContext :: Disallowed ( ImplTraitPosition :: ConstTy ) ,
932934 ) ;
933935 // Trait associated consts don't need an expression/body.
934- let rhs = if rhs_kind . has_expr ( ) {
935- Some ( this. lower_const_item_rhs ( rhs_kind , i. span ) )
936+ let rhs = if body . is_some ( ) {
937+ Some ( this. lower_const_item_rhs ( body , * kind , i. span ) )
936938 } else {
937939 None
938940 } ;
@@ -941,7 +943,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
941943 ) ;
942944
943945 if define_opaque. is_some ( ) {
944- if rhs_kind . has_expr ( ) {
946+ if body . is_some ( ) {
945947 self . lower_define_opaque ( hir_id, & define_opaque) ;
946948 } else {
947949 self . dcx ( ) . span_err (
@@ -951,7 +953,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
951953 }
952954 }
953955
954- ( * ident, generics, kind, rhs_kind . has_expr ( ) )
956+ ( * ident, generics, kind, body . is_some ( ) )
955957 }
956958 AssocItemKind :: Fn ( Fn { sig, ident, generics, body : None , define_opaque, .. } ) => {
957959 // FIXME(contracts): Deny contract here since it won't apply to
@@ -1180,7 +1182,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
11801182 ident,
11811183 generics,
11821184 ty,
1183- rhs_kind,
1185+ body,
1186+ kind,
11841187 define_opaque,
11851188 ..
11861189 } ) => (
@@ -1194,7 +1197,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
11941197 ImplTraitContext :: Disallowed ( ImplTraitPosition :: ConstTy ) ,
11951198 ) ;
11961199 this. lower_define_opaque ( hir_id, & define_opaque) ;
1197- let rhs = this. lower_const_item_rhs ( rhs_kind , i. span ) ;
1200+ let rhs = this. lower_const_item_rhs ( body , * kind , i. span ) ;
11981201 hir:: ImplItemKind :: Const ( ty, rhs)
11991202 } ,
12001203 ) ,
0 commit comments