-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-edition-2018Area: The 2018 editionArea: The 2018 editionA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.F-rust_2018_preview`#![feature(rust_2018_preview)]``#![feature(rust_2018_preview)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone
Description
Consider this test case in Rust 2018 (playground):
mod foo {
pub(crate) trait Bar {
fn bar(&self) { }
}
impl Bar for u32 { }
}
fn main() {
let x: u32 = 22;
x.bar();
}
I get this error:
error[E0599]: no method named `bar` found for type `u32` in the current scope
--> src/main.rs:11:7
|
11 | x.bar();
| ^^^
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
|
1 | use foo::Bar;
|
I would like to see use crate::foo::Bar
, however.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-edition-2018Area: The 2018 editionArea: The 2018 editionA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.F-rust_2018_preview`#![feature(rust_2018_preview)]``#![feature(rust_2018_preview)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.