Skip to content

Commit

Permalink
Merge pull request #1416 from dtolnay/patherrors
Browse files Browse the repository at this point in the history
Improve error reporting in path parser
  • Loading branch information
dtolnay authored Mar 20, 2023
2 parents eaf6215 + 7bb31b1 commit e7bb238
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,9 @@ pub(crate) mod parsing {
segments.push_punct(punct);
}
if segments.is_empty() {
return Err(input.error("expected path"));
return Err(input.parse::<Ident>().unwrap_err());
} else if segments.trailing_punct() {
return Err(input.error("expected path segment"));
return Err(input.error("expected path segment after `::`"));
}
segments
},
Expand Down

0 comments on commit e7bb238

Please sign in to comment.