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

Rollup of 6 pull requests #73617

Merged
merged 14 commits into from
Jun 22, 2020
Merged

Rollup of 6 pull requests #73617

merged 14 commits into from
Jun 22, 2020

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost

sollyucko and others added 14 commits June 20, 2020 15:51
This fixes an issue with the following sample:

    mod foo {
	mod inaccessible {
	    pub struct X;
	}
	pub mod avail {
	    pub struct X;
	}
    }

    fn main() { X; }

Instead of suggesting both `use crate::foo::inaccessible::X;` and `use
crate::foo::avail::X;`, it should only suggest the latter.

It is done by trimming the list of suggestions from inaccessible paths
if accessible paths are present.

Visibility is checked with `is_accessible_from` now instead of being
hard-coded.

-

Some tests fixes are trivial, and others require a bit more explaining,
here are my comments:

src/test/ui/issues/issue-35675.stderr: Only needs to make the enum
public to have the suggestion make sense.

src/test/ui/issues/issue-42944.stderr: Importing the tuple struct won't
help because its constructor is not visible, so the attempted
constructor does not work. In that case, it's better not to suggest it.
The case where the constructor is public is covered in `issue-26545.rs`.
…rochenkov

Prefer accessible paths in 'use' suggestions

This PR addresses issue rust-lang#26454, where `use` suggestions are made for paths that don't work. For example:

```rust
mod foo {
    mod bar {
        struct X;
    }
}

fn main() { X; } // suggests `use foo::bar::X;`
```
…from, r=Amanieu

deprecate wrapping_offset_from

As per rust-lang#41079 (comment) which seems like a consensus.

r? @Amanieu
…ulacrum

Do not send a notification for P-high stable regressions

This is kind of a hack to only match nightly and beta regressions, but not stable regressions. See my tests [on the playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6ff8a809162118aa2951f2ff12400067).

r? @spastorino cc @Mark-Simulacrum
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=6

@bors
Copy link
Contributor

bors commented Jun 22, 2020

📌 Commit c5e6f48 has been approved by Dylan-DPC

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jun 22, 2020
@bors
Copy link
Contributor

bors commented Jun 22, 2020

⌛ Testing commit c5e6f48 with merge 62878c2...

@bors
Copy link
Contributor

bors commented Jun 22, 2020

☀️ Test successful - checks-azure
Approved by: Dylan-DPC
Pushing 62878c2 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 22, 2020
@bors bors merged commit 62878c2 into rust-lang:master Jun 22, 2020
@bors bors mentioned this pull request Jun 22, 2020
@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
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants