Skip to content

Commit

Permalink
Preserve span of LexError on conversion to syn::Error
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Apr 1, 2021
1 parent 16781e7 commit 28915db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -35,7 +35,7 @@ proc-macro = ["proc-macro2/proc-macro", "quote/proc-macro"]
test = ["syn-test-suite/all-features"]

[dependencies]
proc-macro2 = { version = "1.0.23", default-features = false }
proc-macro2 = { version = "1.0.26", default-features = false }
quote = { version = "1.0", optional = true, default-features = false }
unicode-xid = "0.2"

Expand Down
2 changes: 1 addition & 1 deletion src/error.rs
Expand Up @@ -349,7 +349,7 @@ impl std::error::Error for Error {}

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

Expand Down

0 comments on commit 28915db

Please sign in to comment.