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

Add re-exports to use suggestions #73652

Merged
merged 2 commits into from
Jun 24, 2020

Conversation

da-x
Copy link
Member

@da-x da-x commented Jun 23, 2020

In the following example, an inaccessible path is suggested via use foo::bar::X; whereas an accessible public exported path can be suggested instead.

mod foo {
    mod bar {
        pub struct X;
    }
    pub use self::bar::X;
}

fn main() { X; }

This fixes the issue.

In the following example, an inaccessible path is suggested via
`use foo::bar::X;` whereas an accessible public exported path can
be suggested instead.

```
mod foo {
    mod bar {
        pub struct X;
    }
    pub use self::bar::X;
}

fn main() { X; }
```

This fixes the issue.
@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 Jun 23, 2020
@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 Jun 23, 2020
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jun 23, 2020

📌 Commit 037e930 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 23, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 24, 2020
…ons, r=petrochenkov

Add re-exports to use suggestions

In the following example, an inaccessible path is suggested via `use foo::bar::X;` whereas an accessible public exported path can be suggested instead.

```rust
mod foo {
    mod bar {
        pub struct X;
    }
    pub use self::bar::X;
}

fn main() { X; }
```

This fixes the issue.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 24, 2020
Rollup of 6 pull requests

Successful merges:

 - rust-lang#73638 (Remove unused crate imports in 2018 edition crates)
 - rust-lang#73639 (Change heuristic for determining range literal)
 - rust-lang#73646 (Add some regression tests)
 - rust-lang#73652 (Add re-exports to use suggestions)
 - rust-lang#73667 (Update BTreeMap::new() doc)
 - rust-lang#73675 (Update books)

Failed merges:

r? @ghost
@bors bors merged commit 2a6e660 into rust-lang:master Jun 24, 2020
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 25, 2021
Do not mention a reexported item if it's private

Fixes rust-lang#90113
The _actual_ regression was introduced in rust-lang#73652, then rust-lang#88838 made it worse. This fixes the issue by not counting such an import as a candidate.
@cuviper cuviper added this to the 1.46 milestone May 2, 2024
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.

5 participants