-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map invalid Spans to DUMMY_SP during crate metadata encoding. #47177
Map invalid Spans to DUMMY_SP during crate metadata encoding. #47177
Conversation
This mirrors what we for stabilizing the incr. comp. cache and is necessary for reproducible builds.
src/librustc_metadata/encoder.rs
Outdated
|
||
let span = span.data(); | ||
|
||
if span.lo > span.hi { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I mentioned in #47066 (comment), this should not be possible when you use Span
.
Span
uses encoding lo
+ len
, similarly to metadata, so it can't represent spans with lo > hi
.
Thanks, @petrochenkov, I replaced the |
@bors: r+ Looks great! |
📌 Commit 30d921f has been approved by |
…tadata-encoding, r=alexcrichton Map invalid Spans to DUMMY_SP during crate metadata encoding. This mirrors what we do for stabilizing the incr. comp. cache and is necessary for reproducible builds. For the incr. comp. cache, we *have* to do this because the encoding there cannot represent broken Spans. Metadata encoding has to be in sync with that as not to get unexpected interactions when compiling incrementally. This should help with fixing issue #47066. r? @alexcrichton
☀️ Test successful - status-appveyor, status-travis |
This mirrors what we do for stabilizing the incr. comp. cache and is necessary for reproducible builds. For the incr. comp. cache, we have to do this because the encoding there cannot represent broken Spans. Metadata encoding has to be in sync with that as not to get unexpected interactions when compiling incrementally.
This should help with fixing issue #47066.
r? @alexcrichton