]> git.lizzy.rs Git - rust.git/commitdiff
Update compiler/rustc_parse/src/parser/expr.rs
authorMichael Howell <michael@notriddle.com>
Tue, 12 Jul 2022 14:34:49 +0000 (07:34 -0700)
committerMichael Howell <michael@notriddle.com>
Tue, 12 Jul 2022 16:51:20 +0000 (09:51 -0700)
Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
compiler/rustc_parse/src/parser/expr.rs

index f2765e4997ce4590ebfab14b743287f399a0ecc3..52fefa2ebe590c7ddd3211b3d286d12cd97af136 100644 (file)
@@ -3012,7 +3012,7 @@ pub(super) fn parse_struct_fields(
                 }
             };
 
-            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));