Skip to content

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

Closed
@nikomatsakis

Description

@nikomatsakis

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/ ?

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions