Don't use unwrap
after calling Span.join
#25
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The method
Span.join
will returnNone
if the start and endSpan
sare from different files. This is currently difficult to observe in
practice due to rust-lang/rust#43081, which causes span information
(including file information) to be lost in many cases.
However, PR rust-lang/rust#73084 will cause
Spans
to be properlypreserved in many more cases. This will cause
rocket
to to stopcompiling, as this code will end up getting hit with spans from
different files (one from rocket, and one from the
result
identdefined in the
pear_try!
macro.To reproduce the issue:
you don't already have it
rustup-toolchain-install-master 879b8cb7dc2ad9102994457e73cf78d124926ea5
(this corresponds to the latest commit from Re-land PR #72388: Recursively expand
TokenKind::Interpolated
inprobably_equal_for_proc_macro
rust-lang/rust#73084)Rocket
checkout, runcargo +879b8cb7dc2ad9102994457e73cf78d124926ea5 build
Pear
I've based this PR on the commit for
Pear 0.1.2
, since the masterbranch has many breaking changes. I would recommend merging this change
into a separate branch, and making a new
0.1.3
point release.