Skip to content

incr. comp.: Take spans into account for ICH#36025

Merged
bors merged 14 commits intorust-lang:masterfrom
michaelwoerister:incr-comp-hash-spans
Sep 6, 2016
Merged

incr. comp.: Take spans into account for ICH#36025
bors merged 14 commits intorust-lang:masterfrom
michaelwoerister:incr-comp-hash-spans

Conversation

@michaelwoerister
Copy link
Copy Markdown
Member

@michaelwoerister michaelwoerister commented Aug 26, 2016

This PR makes the ICH (incr. comp. hash) take spans into account when debuginfo is enabled.

A side-effect of this is that the SVH (which is based on the ICHs of all items in the crate) becomes sensitive to the tiniest change in a code base if debuginfo is enabled. Since we are not trying to model ABI compatibility via the SVH anymore (this is done via the crate disambiguator now), this should be not be a problem.

Fixes #33888.
Fixes #32753.

@rust-highfive
Copy link
Copy Markdown
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Rename this to CachingCodemapView.

@bors
Copy link
Copy Markdown
Collaborator

bors commented Aug 27, 2016

☔ The latest upstream changes (presumably #36030) made this pull request unmergeable. Please resolve the merge conflicts.

@michaelwoerister michaelwoerister changed the title WIP: Take spans into account for ICH incr. comp.: Take spans into account for ICH Aug 29, 2016
@michaelwoerister
Copy link
Copy Markdown
Member Author

This is ready for review now.

// collect a deterministic hash of def-ids that we have seen
def_path_hashes: &'a mut DefPathHashes<'hash, 'tcx>,
hash_spans: bool,
codemap: CachedCodemapView<'tcx>,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think it would be better if this lived one level up, next to the DefPathHashes, so that we can cache across items.

@nikomatsakis
Copy link
Copy Markdown
Contributor

r=me modulo comments about span hashing

@michaelwoerister
Copy link
Copy Markdown
Member Author

@bors r=nikomatsakis

@bors
Copy link
Copy Markdown
Collaborator

bors commented Aug 31, 2016

📌 Commit 4549b6b has been approved by nikomatsakis

@bors
Copy link
Copy Markdown
Collaborator

bors commented Sep 1, 2016

☔ The latest upstream changes (presumably #35718) made this pull request unmergeable. Please resolve the merge conflicts.

@michaelwoerister
Copy link
Copy Markdown
Member Author

@bors r=nikomatsakis

rebased.

@bors
Copy link
Copy Markdown
Collaborator

bors commented Sep 1, 2016

📌 Commit 7310a8f has been approved by nikomatsakis

@bors
Copy link
Copy Markdown
Collaborator

bors commented Sep 2, 2016

⌛ Testing commit 7310a8f with merge 4c70c01...

@bors
Copy link
Copy Markdown
Collaborator

bors commented Sep 2, 2016

💔 Test failed - auto-win-gnu-32-opt-rustbuild

@michaelwoerister
Copy link
Copy Markdown
Member Author

@bors retry

@michaelwoerister
Copy link
Copy Markdown
Member Author

@bors r-

Want to take a look at the failed test on travis first...

@michaelwoerister
Copy link
Copy Markdown
Member Author

@bors retry

Couldn't reproduce the test failure.

@michaelwoerister
Copy link
Copy Markdown
Member Author

@bors r=nikomatsakis

@bors
Copy link
Copy Markdown
Collaborator

bors commented Sep 2, 2016

📌 Commit 7310a8f has been approved by nikomatsakis

@bors
Copy link
Copy Markdown
Collaborator

bors commented Sep 3, 2016

⌛ Testing commit 7310a8f with merge 3af7da5...

@bors
Copy link
Copy Markdown
Collaborator

bors commented Sep 3, 2016

💔 Test failed - auto-win-msvc-64-cargotest

@michaelwoerister
Copy link
Copy Markdown
Member Author

Can reproduce, will investigate...

@nikomatsakis
Copy link
Copy Markdown
Contributor

r=me on the last commit

@michaelwoerister
Copy link
Copy Markdown
Member Author

@bors r=nikomatsakis

@bors
Copy link
Copy Markdown
Collaborator

bors commented Sep 6, 2016

📌 Commit 3057b7b has been approved by nikomatsakis

@bors
Copy link
Copy Markdown
Collaborator

bors commented Sep 6, 2016

⌛ Testing commit 3057b7b with merge 923bac4...

bors added a commit that referenced this pull request Sep 6, 2016
…atsakis

incr. comp.: Take spans into account for ICH

This PR makes the ICH (incr. comp. hash) take spans into account when debuginfo is enabled.

A side-effect of this is that the SVH (which is based on the ICHs of all items in the crate) becomes sensitive to the tiniest change in a code base if debuginfo is enabled. Since we are not trying to model ABI compatibility via the SVH anymore (this is done via the crate disambiguator now), this should be not be a problem.

Fixes #33888.
Fixes #32753.
@bors bors merged commit 3057b7b into rust-lang:master Sep 6, 2016
nnethercote added a commit to nnethercote/rust that referenced this pull request Apr 7, 2026
This impl skips over a handful of attributes as if they aren't there.
This skipping originated all the way back in rust-lang#36025, and was extended a
couple of times, e.g. in rust-lang#36370. Those PRs don't have any explanation of
why the skipping exists. Removing the impl (and falling back to the
default impl for `[T]`) doesn't seem to have any effects.
nnethercote added a commit to nnethercote/rust that referenced this pull request Apr 7, 2026
This impl skips:
- All doc comments
- A handful of other attributes, mostly `rustc_*` ones related to
  incremental compilation testing.

This skipping originated in rust-lang#36025 and was extended a couple of times,
e.g. in rust-lang#36370. Those PRs don't have any explanation of why the skipping
exists. Perhaps the reasoning was that doc comments should only affect
rustdoc and rustdoc doesn't use incremental compilation? But doc
comments end up in metadata, and there is a query `attrs_for_def` that
returns a `&'tcx [hir::Attribute]`. So skipping some attributes just
seems plainly wrong.

This commit removes the impl, which means `[hir::Attribute]` hashing
falls back to the default impl for `[T]`. This has no noticeable effect
on the test suite. It does slightly hurt performance, because of the doc
comments. This perf regression seems worth it for the correcteness
benefits.
nnethercote added a commit to nnethercote/rust that referenced this pull request Apr 7, 2026
This impl skips:
- All doc comments
- A handful of other attributes, mostly `rustc_*` ones related to
  incremental compilation testing.

This skipping originated in rust-lang#36025 and was extended a couple of times,
e.g. in rust-lang#36370. Those PRs don't have any explanation of why the skipping
exists. Perhaps the reasoning was that doc comments should only affect
rustdoc and rustdoc doesn't use incremental compilation? But doc
comments end up in metadata, and there is a query `attrs_for_def` that
returns a `&'tcx [hir::Attribute]`. So skipping some attributes just
seems plainly wrong.

This commit removes the impl, which means `[hir::Attribute]` hashing
falls back to the default impl for `[T]`. This has no noticeable effect
on the test suite. It does slightly hurt performance, because of the doc
comments. This perf regression seems worth it for the correctness
benefits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants