Skip to content

Commit

Permalink
Update compiler/rustc_parse/src/parser/expr.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
  • Loading branch information
notriddle and petrochenkov committed Jul 12, 2022
1 parent 6713dde commit 9fcb9c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_parse/src/parser/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 9fcb9c6

Please sign in to comment.