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

Detect when suggested paths enter extern crates more rigorously #84113

Merged
merged 1 commit into from
Apr 17, 2021

Conversation

SNCPlay42
Copy link
Contributor

When reporting resolution errors, the compiler tries to avoid suggesting importing inaccessible paths from other crates. However, the search for suggestions only recognized when it was entering a crate root directly, and so failed to recognize a path like crate::module::private_item, where module was imported from another crate with use other_crate::module, as entering another crate.

Fixes #80079
Fixes #84081

@rust-highfive
Copy link
Collaborator

r? @lcnr

(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 Apr 11, 2021
@jyn514
Copy link
Member

jyn514 commented Apr 12, 2021

r? @petrochenkov

@rust-highfive rust-highfive assigned petrochenkov and unassigned lcnr Apr 12, 2021
@jyn514 jyn514 added A-diagnostics Area: Messages for errors, warnings, and lints A-resolve Area: Name resolution T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 12, 2021
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Apr 16, 2021

📌 Commit a3ee0bb 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 Apr 16, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Apr 17, 2021
…r=petrochenkov

Detect when suggested paths enter extern crates more rigorously

When reporting resolution errors, the compiler tries to avoid suggesting importing inaccessible paths from other crates. However, the search for suggestions only recognized when it was entering a crate root directly, and so failed to recognize a path like `crate::module::private_item`, where `module` was imported from another crate with `use other_crate::module`, as entering another crate.

Fixes rust-lang#80079
Fixes rust-lang#84081
@bors
Copy link
Contributor

bors commented Apr 17, 2021

⌛ Testing commit a3ee0bb with merge 42e5621...

@bors
Copy link
Contributor

bors commented Apr 17, 2021

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing 42e5621 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 17, 2021
@bors bors merged commit 42e5621 into rust-lang:master Apr 17, 2021
@rustbot rustbot added this to the 1.53.0 milestone Apr 17, 2021
@SNCPlay42 SNCPlay42 deleted the suggestion-extern-crate branch April 18, 2021 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-resolve Area: Name resolution merged-by-bors This PR was explicitly merged by bors. 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
7 participants