ICH: Hash expression spans if their source location is captured for panics.#37513
Merged
bors merged 2 commits intorust-lang:masterfrom Nov 3, 2016
Merged
ICH: Hash expression spans if their source location is captured for panics.#37513bors merged 2 commits intorust-lang:masterfrom
bors merged 2 commits intorust-lang:masterfrom
Conversation
nikomatsakis
approved these changes
Nov 1, 2016
| } | ||
|
|
||
| fn maybe_enable_overflow_checks(&mut self, item_attrs: &[ast::Attribute]) { | ||
| if attr::contains_name(item_attrs, "rustc_inherit_overflow_checks") { |
Contributor
There was a problem hiding this comment.
good catch, i'd forgotten about this, can we add this to the test?
Member
Author
|
@bors r=nikomatsakis Test case added. Thanks for the review! |
Collaborator
|
📌 Commit 0e391bf has been approved by |
sophiajt
pushed a commit
to sophiajt/rust
that referenced
this pull request
Nov 2, 2016
…r=nikomatsakis ICH: Hash expression spans if their source location is captured for panics. Since the location of some expressions is captured in error message constants, it has an influence on machine code and consequently we need to take them into account by the incr. comp. hash. This PR makes this happen for `+, -, *, /, %` and for array indexing -- let me know if I forgot anything. In the future we might want to change the codegen strategy for those error messages, so that they are stored in a separate object file with a stable symbol name, so that only this object file has to be regenerated when source locations change. This strategy would also eliminate unnecessary duplications due to monomorphization, as @arielb1 has pointed out on IRC. I opened rust-lang#37512, so we don't forget about this. r? @nikomatsakis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Since the location of some expressions is captured in error message constants, it has an influence on machine code and consequently we need to take them into account by the incr. comp. hash. This PR makes this happen for
+, -, *, /, %and for array indexing -- let me know if I forgot anything.In the future we might want to change the codegen strategy for those error messages, so that they are stored in a separate object file with a stable symbol name, so that only this object file has to be regenerated when source locations change. This strategy would also eliminate unnecessary duplications due to monomorphization, as @arielb1 has pointed out on IRC. I opened #37512, so we don't forget about this.
r? @nikomatsakis