Skip to content

Store idents for DefPathData into crate metadata - #70077

Merged
bors merged 2 commits into
rust-lang:masterfrom
Aaron1011:feature/new-def-path-ident
Mar 24, 2020
Merged

Store idents for DefPathData into crate metadata#70077
bors merged 2 commits into
rust-lang:masterfrom
Aaron1011:feature/new-def-path-ident

Conversation

@Aaron1011

Copy link
Copy Markdown
Contributor

Previously, we threw away the Span associated with a definition's
identifier when we encoded crate metadata, causing us to lose location
and hygiene information.

We now store the identifier's Span in a side table, which gets encoded
into the crate metadata. When we decode items from the metadata, we
combine the name and span back into an Ident.

This improves the output of several tests, which previously had messages
suppressed due to dummy spans.

This is a prerequisite for #68686, since throwing away a Span means
that we lose hygiene information.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @eddyb

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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 17, 2020
@petrochenkovpetrochenkov self-assigned this Mar 17, 2020
Comment threadsrc/librustc_metadata/rmeta/encoder.rs Outdated
Comment threadsrc/librustc_metadata/rmeta/decoder.rs Outdated
@petrochenkovpetrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 18, 2020
@Aaron1011

Copy link
Copy Markdown
ContributorAuthor

@petrochenkov: Did you want to do a perf run for this?

@Aaron1011Aaron1011 changed the title Store idents for DefPathData in a side tableStore idents for DefPathData into crate metadataMar 18, 2020
@bors

This comment has been minimized.

@Aaron1011
Aaron1011force-pushed the feature/new-def-path-ident branch from 50d5890 to 3760e40CompareMarch 19, 2020 04:01
@petrochenkov

Copy link
Copy Markdown
Contributor

@Aaron1011
Yes, it would be good to run perf on this PR before merging it.

Comment threadsrc/librustc_metadata/rmeta/decoder.rs Outdated
Comment threadsrc/librustc_metadata/rmeta/decoder.rs Outdated
Comment threadsrc/librustc_metadata/rmeta/encoder.rs Outdated
Comment threadsrc/librustc_metadata/rmeta/encoder.rs Outdated
Comment threadsrc/librustc_metadata/rmeta/decoder.rs Outdated
@bors

This comment has been minimized.

@Aaron1011
Aaron1011force-pushed the feature/new-def-path-ident branch from 3760e40 to b442340CompareMarch 19, 2020 19:01
@Aaron1011

Copy link
Copy Markdown
ContributorAuthor

@petrochenkov: I've addressed your comments.

@petrochenkovpetrochenkov added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 19, 2020
@rust-highfive

This comment has been minimized.

Comment threadsrc/librustc_metadata/rmeta/encoder.rs Outdated
Comment threadsrc/librustc_metadata/rmeta/encoder.rs Outdated
Comment threadsrc/librustc_metadata/rmeta/encoder.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

An accidental submodule update breaks CI.

@petrochenkovpetrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 19, 2020
@Aaron1011
Aaron1011force-pushed the feature/new-def-path-ident branch from e7d4cae to 35fb1cbCompareMarch 20, 2020 01:55
@Aaron1011

Copy link
Copy Markdown
ContributorAuthor

@petrochenkov: Updated. If this looks good to you, I'll squash the commits.

@petrochenkovpetrochenkov added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 20, 2020
@petrochenkov

Copy link
Copy Markdown
Contributor

@bors try @rust-timer queue

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 20, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 22, 2020
…t, r=petrochenkov
Store idents for `DefPathData` into crate metadata
Previously, we threw away the `Span` associated with a definition's
identifier when we encoded crate metadata, causing us to lose location
and hygiene information.
We now store the identifier's `Span` in a side table, which gets encoded
into the crate metadata. When we decode items from the metadata, we
combine the name and span back into an `Ident`.
This improves the output of several tests, which previously had messages
suppressed due to dummy spans.
This is a prerequisite for rust-lang#68686, since throwing away a `Span` means
that we lose hygiene information.
@Centril

Copy link
Copy Markdown
Contributor

Failed in #70288 (comment), @bors r-

@borsbors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 23, 2020
Previously, we threw away the `Span` associated with a definition's
identifier when we encoded crate metadata, causing us to lose location
and hygiene information.
We now store the identifier's `Span` in the crate metadata.
When we decode items from the metadata, we combine
the name and span back into an `Ident`.
This improves the output of several tests, which previously had messages
suppressed due to dummy spans.
This is a prerequisite for rust-lang#68686, since throwing away a `Span` means
that we lose hygiene information.
@Aaron1011

Copy link
Copy Markdown
ContributorAuthor

This appears to be another instance of #53081: apparently, there are platform-specific issues with printing sysroot spans, which is causing some platforms to not print the output expected by the tests.

@Aaron1011
Aaron1011force-pushed the feature/new-def-path-ident branch from 1f13a4f to 86b8deaCompareMarch 23, 2020 06:05
@Aaron1011

Copy link
Copy Markdown
ContributorAuthor

@petrochenkov: I've ignored the failing tests on the relevant platforms. It's unfortunate that this is required, but I'd prefer not to block this PR on resolving #53081.

@petrochenkov

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Mar 23, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 86b8dea has been approved by petrochenkov

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 23, 2020
Centril added a commit to Centril/rust that referenced this pull request Mar 24, 2020
…t, r=petrochenkov
Store idents for `DefPathData` into crate metadata
Previously, we threw away the `Span` associated with a definition's
identifier when we encoded crate metadata, causing us to lose location
and hygiene information.
We now store the identifier's `Span` in a side table, which gets encoded
into the crate metadata. When we decode items from the metadata, we
combine the name and span back into an `Ident`.
This improves the output of several tests, which previously had messages
suppressed due to dummy spans.
This is a prerequisite for rust-lang#68686, since throwing away a `Span` means
that we lose hygiene information.
@CentrilCentril mentioned this pull request Mar 24, 2020
Centril added a commit to Centril/rust that referenced this pull request Mar 24, 2020
…t, r=petrochenkov
Store idents for `DefPathData` into crate metadata
Previously, we threw away the `Span` associated with a definition's
identifier when we encoded crate metadata, causing us to lose location
and hygiene information.
We now store the identifier's `Span` in a side table, which gets encoded
into the crate metadata. When we decode items from the metadata, we
combine the name and span back into an `Ident`.
This improves the output of several tests, which previously had messages
suppressed due to dummy spans.
This is a prerequisite for rust-lang#68686, since throwing away a `Span` means
that we lose hygiene information.
@CentrilCentril mentioned this pull request Mar 24, 2020
@CentrilCentril mentioned this pull request Mar 24, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 24, 2020
Rollup of 8 pull requests
Successful merges:
- rust-lang#68884 (Make the `type_of` return a generic type for generators)
- rust-lang#69788 (Fix sequence of Type and Trait in optin-builtin-traits in Unstable Book)
- rust-lang#70074 (Expand: nix all fatal errors)
- rust-lang#70077 (Store idents for `DefPathData` into crate metadata)
- rust-lang#70213 (traits/fulfill: allow `stalled_on` to track `ty::Const::Infer(_)` (unused yet).)
- rust-lang#70259 (Use Reveal::All in MIR optimizations)
- rust-lang#70284 (correctly handle const params in type_of)
- rust-lang#70289 (Refactor `codegen`)
Failed merges:
r? @ghost
@bors
bors merged commit d626f5b into rust-lang:masterMar 24, 2020
@Aaron1011
Aaron1011 deleted the feature/new-def-path-ident branch March 24, 2020 14:50
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@Aaron1011@rust-highfive@bors@petrochenkov@rust-timer@Centril@eddyb