Skip to content

Commit

Permalink
Improve error message on empty parens inside parse_nested_meta
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Mar 28, 2023
1 parent 0296180 commit 0b7da96
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/meta.rs
Original file line number Diff line number Diff line change
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 0b7da96

Please sign in to comment.