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

Improve and test cross-crate hygiene #90202

Merged
merged 5 commits into from
Oct 30, 2021

Conversation

matthewjasper
Copy link
Contributor

  • Decode the parent expansion for traits and enums in rustc_resolve, this was already being used for resolution in typeck
  • Avoid suggesting importing names with def-site hygiene, since it's often not useful
  • Add more tests

r? @petrochenkov

- Always use the ExpnId serialized to `tables`
- Use the Id for traits and enums from other crates in resolution.
This will potentially hide a few correct suggestions, but importing
these items from another module is not generally possible.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 23, 2021
@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor

Could you add a couple of sentences of text to every test, explaining what that test aims to check?

@petrochenkov petrochenkov 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 Oct 26, 2021
@apiraino apiraino added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 28, 2021
This avoids having to decode 2 `Lazy`s when decoding a modules exports.
@petrochenkov petrochenkov 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 Oct 29, 2021
@petrochenkov
Copy link
Contributor

Thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Oct 29, 2021

📌 Commit a76a2d4 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 29, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 30, 2021
…laumeGomez

Rollup of 5 pull requests

Successful merges:

 - rust-lang#90156 (Remove underlines from non-top docblocks.)
 - rust-lang#90183 (Show all Deref implementations recursively)
 - rust-lang#90202 (Improve and test cross-crate hygiene)
 - rust-lang#90375 (Use `is_global` in `candidate_should_be_dropped_in_favor_of`)
 - rust-lang#90399 (Skipping verbose diagnostic suggestions when calling .as_ref() on type not implementing AsRef)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 1a1f525 into rust-lang:master Oct 30, 2021
@rustbot rustbot added this to the 1.58.0 milestone Oct 30, 2021
@matthewjasper matthewjasper deleted the xcrate-hygiene branch October 30, 2021 23:16
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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants