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

rustc: use LocalDefId instead of DefId in TypeckTables. #70119

Merged
merged 1 commit into from
Mar 21, 2020

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Mar 18, 2020

The logic in TypeckTables' implementation of HashStable, which created DefIds by combining a CrateNum from a DefId and a DefIndex from a LocalDefId, bothered me a bit.

I don't know how much this matters, but it works so might as well submit it.

@bors

This comment has been minimized.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 19, 2020
@eddyb eddyb force-pushed the typeck-tables-local-def-id branch from 8868226 to 8c93a29 Compare March 19, 2020 07:13
Comment on lines -735 to -740
let var_owner_def_id = DefId {
krate: local_id_root.krate,
index: var_path.hir_id.owner.local_def_index,
};
let closure_def_id =
DefId { krate: local_id_root.krate, index: closure_expr_id.local_def_index };
Copy link
Member Author

@eddyb eddyb Mar 19, 2020

Choose a reason for hiding this comment

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

This is specifically what I kept seeing while working on #66131, and it started to bother me.

@petrochenkov

This comment has been minimized.

@petrochenkov petrochenkov added S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. 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
@eddyb eddyb force-pushed the typeck-tables-local-def-id branch from 8c93a29 to 06d723a Compare March 19, 2020 09:21
@eddyb eddyb force-pushed the typeck-tables-local-def-id branch from 06d723a to f8178c7 Compare March 19, 2020 12:26
@eddyb eddyb added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. labels Mar 19, 2020
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Mar 19, 2020

📌 Commit f8178c7 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 Mar 19, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 21, 2020
Rollup of 6 pull requests

Successful merges:

 - rust-lang#69497 (Don't unwind when hitting the macro expansion recursion limit)
 - rust-lang#69901 (add #[rustc_layout(debug)])
 - rust-lang#69910 (Avoid query type in generics)
 - rust-lang#69955 (Fix abort-on-eprintln during process shutdown)
 - rust-lang#70032 (put type params in front of const params in generics_of)
 - rust-lang#70119 (rustc: use LocalDefId instead of DefId in TypeckTables.)

Failed merges:

r? @ghost
@bors bors merged commit f1ab750 into rust-lang:master Mar 21, 2020
@eddyb eddyb deleted the typeck-tables-local-def-id branch March 21, 2020 17:21
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.

3 participants