@@ -257,13 +257,13 @@ impl<'a> Parser<'a> {
257257 } else {
258258 self . recover_const_mut ( const_span) ;
259259 self . recover_missing_kw_before_item ( ) ?;
260- let ( ident, generics, ty, body ) = self . parse_const_item ( attrs) ?;
260+ let ( ident, generics, ty, rhs ) = self . parse_const_item ( attrs) ?;
261261 ItemKind :: Const ( Box :: new ( ConstItem {
262262 defaultness : def_ ( ) ,
263263 ident,
264264 generics,
265265 ty,
266- body ,
266+ rhs ,
267267 define_opaque : None ,
268268 } ) )
269269 }
@@ -1012,13 +1012,13 @@ impl<'a> Parser<'a> {
10121012 define_opaque,
10131013 } ) => {
10141014 self . dcx ( ) . emit_err ( errors:: AssociatedStaticItemNotAllowed { span } ) ;
1015- let body = expr. map ( ConstItemRhs :: Body ) ;
1015+ let rhs = expr. map ( ConstItemRhs :: Body ) ;
10161016 AssocItemKind :: Const ( Box :: new ( ConstItem {
10171017 defaultness : Defaultness :: Final ,
10181018 ident,
10191019 generics : Generics :: default ( ) ,
10201020 ty,
1021- body ,
1021+ rhs ,
10221022 define_opaque,
10231023 } ) )
10241024 }
@@ -1252,7 +1252,7 @@ impl<'a> Parser<'a> {
12521252 let kind = match ForeignItemKind :: try_from ( kind) {
12531253 Ok ( kind) => kind,
12541254 Err ( kind) => match kind {
1255- ItemKind :: Const ( box ConstItem { ident, ty, body , .. } ) => {
1255+ ItemKind :: Const ( box ConstItem { ident, ty, rhs , .. } ) => {
12561256 let const_span = Some ( span. with_hi ( ident. span . lo ( ) ) )
12571257 . filter ( |span| span. can_be_used_for_suggestions ( ) ) ;
12581258 self . dcx ( ) . emit_err ( errors:: ExternItemCannotBeConst {
@@ -1263,7 +1263,7 @@ impl<'a> Parser<'a> {
12631263 ident,
12641264 ty,
12651265 mutability : Mutability :: Not ,
1266- expr : body . map ( |b| match b {
1266+ expr : rhs . map ( |b| match b {
12671267 ConstItemRhs :: TypeConst ( anon_const) => anon_const. value ,
12681268 ConstItemRhs :: Body ( expr) => expr,
12691269 } ) ,
@@ -1465,7 +1465,7 @@ impl<'a> Parser<'a> {
14651465 let before_where_clause =
14661466 if self . may_recover ( ) { self . parse_where_clause ( ) ? } else { WhereClause :: default ( ) } ;
14671467
1468- let body = if self . eat ( exp ! ( Eq ) ) {
1468+ let rhs = if self . eat ( exp ! ( Eq ) ) {
14691469 if attr:: contains_name ( attrs, sym:: type_const) {
14701470 Some ( ConstItemRhs :: TypeConst ( self . parse_expr_anon_const ( ) ?) )
14711471 } else {
@@ -1481,18 +1481,18 @@ impl<'a> Parser<'a> {
14811481 // Users may be tempted to write such code if they are still used to the deprecated
14821482 // where-clause location on type aliases and associated types. See also #89122.
14831483 if before_where_clause. has_where_token
1484- && let Some ( body ) = & body
1484+ && let Some ( rhs ) = & rhs
14851485 {
14861486 self . dcx ( ) . emit_err ( errors:: WhereClauseBeforeConstBody {
14871487 span : before_where_clause. span ,
14881488 name : ident. span ,
1489- body : body . span ( ) ,
1489+ body : rhs . span ( ) ,
14901490 sugg : if !after_where_clause. has_where_token {
1491- self . psess . source_map ( ) . span_to_snippet ( body . span ( ) ) . ok ( ) . map ( |body_s| {
1491+ self . psess . source_map ( ) . span_to_snippet ( rhs . span ( ) ) . ok ( ) . map ( |body_s| {
14921492 errors:: WhereClauseBeforeConstBodySugg {
14931493 left : before_where_clause. span . shrink_to_lo ( ) ,
14941494 snippet : body_s,
1495- right : before_where_clause. span . shrink_to_hi ( ) . to ( body . span ( ) ) ,
1495+ right : before_where_clause. span . shrink_to_hi ( ) . to ( rhs . span ( ) ) ,
14961496 }
14971497 } )
14981498 } else {
@@ -1530,7 +1530,7 @@ impl<'a> Parser<'a> {
15301530
15311531 self . expect_semi ( ) ?;
15321532
1533- Ok ( ( ident, generics, ty, body ) )
1533+ Ok ( ( ident, generics, ty, rhs ) )
15341534 }
15351535
15361536 /// We were supposed to parse `":" $ty` but the `:` or the type was missing.
0 commit comments