Skip to content
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

Derive Eq and Hash for SourceInfo again #65828

Merged
merged 1 commit into from
Oct 26, 2019

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Oct 25, 2019

In https://github.com/bjorn3/rustc_codegen_cranelift/blob/75c24b9c9677600422ec86fa9f4c78fe3678d2ce/src/common.rs#L368 I store it in a indexmap::IndexSet, which requires Eq and Hash. Unfortunately they were removed in #65647, so I can't update to latest nightly.

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 25, 2019
@Mark-Simulacrum
Copy link
Member

It is somewhat concerning to me that we've hit this sort of PR a couple times in the last few days -- I don't have links just now -- I wonder if it's worth at least adding a comment on that derive saying, e.g., "Cranelift, at least as of #65828, is also using these impls so ping @bjorn3 if removing them"

I think I would personally prefer that we instead say something like "Cranelift et al" should wrap our types and we should make that easy if they need these impls, but I understand that Rust makes that quite hard so I don't think we can just do that.

r=me with a comment that lists the derives that are needed for cranelift (like I suggested in my first paragraph)

@Mark-Simulacrum
Copy link
Member

@bors rollup

@bjorn3 bjorn3 force-pushed the add_source_info_eq_hash branch from 12c1b46 to f04867c Compare October 25, 2019 19:39
@bjorn3
Copy link
Member Author

bjorn3 commented Oct 25, 2019

Amended with comment. I also checked if indexmap::IndexSet requires any other bounds, but it doesn't.

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Oct 25, 2019

📌 Commit f04867c has been approved by petrochenkov

@bors bors 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-review Status: Awaiting review from the assignee but also interested parties. labels Oct 25, 2019
@bors
Copy link
Contributor

bors commented Oct 26, 2019

⌛ Testing commit f04867c with merge e5740fa9cb12d4c8d6769944f0343bb30a9f948a...

@rust-highfive
Copy link
Collaborator

Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-10-26T04:58:39.5903084Z do so (now or later) by using -b with the checkout command again. Example:
2019-10-26T04:58:39.5903464Z 
2019-10-26T04:58:39.5903564Z   git checkout -b <new-branch-name>
2019-10-26T04:58:39.5903629Z 
2019-10-26T04:58:39.5903741Z HEAD is now at e5740fa9c Auto merge of #65828 - bjorn3:add_source_info_eq_hash, r=petrochenkov
2019-10-26T04:58:39.6267667Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-10-26T04:58:39.6387904Z ==============================================================================
2019-10-26T04:58:39.6388138Z Task         : Bash
2019-10-26T04:58:39.6388214Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-10-26T04:59:58.6955520Z Chocolatey installed 0/1 packages. 1 packages failed.
2019-10-26T04:59:58.6955646Z  See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2019-10-26T04:59:58.6960807Z 
2019-10-26T04:59:58.6964348Z Failures
2019-10-26T04:59:58.6972233Z  - msys2 (exited 1) - msys2 not installed. An error occurred during installation:
2019-10-26T04:59:58.6972398Z  The remote server returned an error: (503) Server Unavailable. Service Unavailable
2019-10-26T04:59:59.1743829Z 
2019-10-26T04:59:59.1827675Z ##[error]Bash exited with code '1'.
2019-10-26T04:59:59.2027526Z ##[section]Starting: Upload CPU usage statistics
2019-10-26T04:59:59.2128509Z ==============================================================================
2019-10-26T04:59:59.2128603Z Task         : Bash
2019-10-26T04:59:59.2128673Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-10-26T04:59:59.5092748Z ========================== Starting Command Output ===========================
2019-10-26T04:59:59.5099644Z [command]"C:\Program Files\Git\bin\bash.exe" --noprofile --norc /d/a/_temp/502e376a-18a5-437b-a30f-1284a01882fa.sh
2019-10-26T04:59:59.5523564Z /d/a/_temp/502e376a-18a5-437b-a30f-1284a01882fa.sh: line 1: aws: command not found
2019-10-26T04:59:59.5552430Z 
2019-10-26T04:59:59.5572018Z ##[error]Bash exited with code '127'.
2019-10-26T04:59:59.5646222Z ##[section]Starting: Checkout
2019-10-26T04:59:59.5749026Z ==============================================================================
2019-10-26T04:59:59.5749290Z Task         : Get sources
2019-10-26T04:59:59.5749369Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors
Copy link
Contributor

bors commented Oct 26, 2019

💔 Test failed - checks-azure

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 26, 2019
@bjorn3
Copy link
Member Author

bjorn3 commented Oct 26, 2019

Spurious network error.

@JohnTitor
Copy link
Member

Indeed, it's a network error.
@bors retry

@bors bors 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-review Status: Awaiting review from the assignee but also interested parties. labels Oct 26, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 26, 2019
…etrochenkov

Derive Eq and Hash for SourceInfo again

In https://github.com/bjorn3/rustc_codegen_cranelift/blob/75c24b9c9677600422ec86fa9f4c78fe3678d2ce/src/common.rs#L368 I store it in a `indexmap::IndexSet`, which requires `Eq` and `Hash`. Unfortunately they were removed in rust-lang#65647, so I can't update to latest nightly.
bors added a commit that referenced this pull request Oct 26, 2019
Rollup of 8 pull requests

Successful merges:

 - #65743 (rustc_typeck: don't record direct callees in generator_interior.)
 - #65761 (libsyntax: Enhance documentation of the AST module)
 - #65772 (Remove the last remaining READMEs)
 - #65773 (Increase spacing for suggestions in diagnostics)
 - #65791 (Adding doc on keyword continue)
 - #65824 (rustc: make DefPathData (and friends) Copy (now that it uses Symbol).)
 - #65828 (Derive Eq and Hash for SourceInfo again)
 - #65842 (Add more information on rustdoc search)

Failed merges:

 - #65825 (rustc: use IndexVec<DefIndex, T> instead of Vec<T>.)

r? @ghost
@bors bors merged commit f04867c into rust-lang:master Oct 26, 2019
@bjorn3 bjorn3 deleted the add_source_info_eq_hash branch October 26, 2019 20:06
@@ -467,7 +467,9 @@ impl<T: Decodable> rustc_serialize::UseSpecializedDecodable for ClearCrossCrate<
/// Grouped information about the source code origin of a MIR entity.
/// Intended to be inspected by diagnostics and debuginfo.
/// Most passes can work with it as a whole, within a single function.
#[derive(Copy, Clone, Debug, PartialEq, RustcEncodable, RustcDecodable, HashStable)]
// The unoffical Cranelift backend, at least as of #65828, needs `SourceInfo` to implement `Eq` and
// `Hash`. Please ping @bjorn3 if removing them.
Copy link
Member

Choose a reason for hiding this comment

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

I don't find this kind of comment particularly useful. Also, I would expect you'd use an IndexVec<SourceScope, ...> instead of working with SourceInfo directly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Comment was suggested at #65828 (comment). I am getting the SourceInfo directly from Statement and Terminator, but I need to get an unique u32 to pass through cranelift as SourceLoc, while being able to get the original SourceInfo back after having compiled a function.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, unless you are emitting variable debuginfo somehow, you'd only need the Span, not the whole SourceInfo.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, unless you are emitting variable debuginfo somehow

Not yet

you'd only need the Span, not the whole SourceInfo.

Indeed only Span is used currently, but I will probably need the rest of the SourceInfo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: 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