Update compiler/rustc_parse/src/parser/expr.rs
Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
This commit is contained in:
parent
6713dde898
commit
9fcb9c6648
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user