Skip to content

Commit

Permalink
Preserve LexError's Display representation in syn::Error
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jan 3, 2024
1 parent 1650c86 commit 7b3286a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ impl std::error::Error for Error {}

impl From<LexError> for Error {
fn from(err: LexError) -> Self {
Error::new(err.span(), "lex error")
Error::new(err.span(), err)
}
}

Expand Down

0 comments on commit 7b3286a

Please sign in to comment.