diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index f2765e4997ce4..52fefa2ebe590 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -3012,7 +3012,7 @@ impl<'a> Parser<'a> { } }; - let is_shorthand = parsed_field.as_ref().map_or(false, |f| f.ident.span == f.expr.span); + let is_shorthand = parsed_field.as_ref().map_or(false, |f| f.is_shorthand); // A shorthand field can be turned into a full field with `:`. // We should point this out. self.check_or_expected(!is_shorthand, TokenType::Token(token::Colon));