Handle repr attribute consistently with every other serde attribute

This commit is contained in:
David Tolnay 2023-03-08 13:57:43 -08:00
parent ea2f7b81d9
commit e4e2956e79
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 2 additions and 1 deletions

View File

@ -583,7 +583,7 @@ impl Container {
let mut is_packed = false;
for attr in &item.attrs {
if attr.path.is_ident("repr") {
if attr.path == REPR {
let _ = attr.parse_args_with(|input: ParseStream| {
while let Some(token) = input.parse()? {
if let TokenTree::Ident(ident) = token {

View File

@ -23,6 +23,7 @@ pub const OTHER: Symbol = Symbol("other");
pub const REMOTE: Symbol = Symbol("remote");
pub const RENAME: Symbol = Symbol("rename");
pub const RENAME_ALL: Symbol = Symbol("rename_all");
pub const REPR: Symbol = Symbol("repr");
pub const SERDE: Symbol = Symbol("serde");
pub const SERIALIZE: Symbol = Symbol("serialize");
pub const SERIALIZE_WITH: Symbol = Symbol("serialize_with");