Skip to content

Commit

Permalink
Merge pull request #1428 from dtolnay/emptyattr
Browse files Browse the repository at this point in the history
Improve error message on empty parens inside parse_nested_meta
  • Loading branch information
dtolnay committed Mar 28, 2023
2 parents 0296180 + 0b7da96 commit 161be5a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/meta.rs
Expand Up @@ -401,6 +401,8 @@ fn parse_meta_path(input: ParseStream) -> Result<Path> {
if input.peek(Ident::peek_any) {
let ident = Ident::parse_any(input)?;
segments.push_value(PathSegment::from(ident));
} else if input.is_empty() {
return Err(input.error("expected nested attribute"));
} else if input.peek(Lit) {
return Err(input.error("unexpected literal in nested attribute, expected ident"));
} else {
Expand Down

0 comments on commit 161be5a

Please sign in to comment.