Commit e9f2bcf
committed
Don't use
The method `Span.join` will return `None` if the start and end `Span`s
are 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 properly
preserved in many more cases. This will cause `rocket` to to stop
compiling, as this code will end up getting hit with spans from
different files (one from rocket, and one from the `result` ident
defined in the `pear_try!` macro.
To reproduce the issue:
1. Checkout SergioBenitez/Rocket#63a4ae048540a6232c3c7c186e9d027081940382
2. Install https://github.com/kennytm/rustup-toolchain-install-master if
you don't already have it
3. Run `rustup-toolchain-install-master 879b8cb7dc2ad9102994457e73cf78d124926ea5`
(this corresponds to the latest commit from rust-lang/rust#73084)
4. From the `Rocket` checkout, run `cargo +879b8cb7dc2ad9102994457e73cf78d124926ea5 build`
5. Observe the panic from `Pear`
I've based this PR on the commit for `Pear 0.1.2`, since the master
branch has many breaking changes. I would recommend merging this change
into a separate branch, and making a new `0.1.3` point release.unwrap after calling Span.join
1 parent a4c5b1d commit e9f2bcf
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
| 210 | + | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| |||
0 commit comments