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

path suggestions in Rust 2018 should point out the change in semantics #55130

Closed
nikomatsakis opened this issue Oct 16, 2018 · 2 comments
Closed
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@nikomatsakis
Copy link
Contributor

In an example like this one (playground):

#![warn(rust_2018_idioms)]

mod bar {
    pub fn x() { }
}

mod baz {
    use bar::x;
}

fn main() {
}

we get the following output in Rust 2018:

error[E0432]: unresolved import `bar`
 --> src/main.rs:8:9
  |
8 |     use bar::x;
  |         ^^^ Did you mean `crate::bar`?

It'd be nice to have an additional note:

error[E0432]: unresolved import `bar`
 --> src/main.rs:8:9
  |
8 |     use bar::x;
  |         ^^^ Did you mean `crate::bar`?
  |
  | = note: `use` statements changed in Rust 2018; read more at XXX

where XXX is probably https://rust-lang-nursery.github.io/edition-guide/ ?

@nikomatsakis nikomatsakis added A-diagnostics Area: Messages for errors, warnings, and lints I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 16, 2018
@nikomatsakis nikomatsakis added this to the Edition 2018 RC 2 milestone Oct 16, 2018
@davidtwco davidtwco self-assigned this Oct 16, 2018
@nikomatsakis
Copy link
Contributor Author

Moving from RC2 milestone to the Release milestone. Feels like something we can backport and I can't see us blocking the release on this.

pietroalbini added a commit to pietroalbini/rust that referenced this issue Oct 23, 2018
path suggestions in Rust 2018 should point out the change in semantics

Fixes rust-lang#55130.

This commit extends existing path suggestions to link to documentation
on the changed semantics of `use` in Rust 2018.

r? @nikomatsakis
@pnkfelix
Copy link
Member

has a PR in flight. no discussion needed AFAICT. removing nomination tag.

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Oct 27, 2018
path suggestions in Rust 2018 should point out the change in semantics

Fixes rust-lang#55130.

This commit extends existing path suggestions to link to documentation
on the changed semantics of `use` in Rust 2018.

r? @nikomatsakis
kennytm added a commit to kennytm/rust that referenced this issue Oct 28, 2018
path suggestions in Rust 2018 should point out the change in semantics

Fixes rust-lang#55130.

This commit extends existing path suggestions to link to documentation
on the changed semantics of `use` in Rust 2018.
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 T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants