-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #52204 - zackmdavis:and_the_crate_of_the_missing_module…
…, r=oli-obk correct import suggestions for edition 2018 For #52202.
- Loading branch information
Showing
3 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// compile-flags: --edition 2018 | ||
|
||
// The local `use` suggestion should start with `crate::` (but the | ||
// standard-library suggestions should not, obviously). | ||
|
||
mod plumbing { | ||
pub struct Drain; | ||
} | ||
|
||
fn main() { | ||
let _d = Drain {}; | ||
//~^ ERROR cannot find struct, variant or union type `Drain` in this scope | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error[E0422]: cannot find struct, variant or union type `Drain` in this scope | ||
--> $DIR/issue-52202-use-suggestions.rs:21:14 | ||
| | ||
LL | let _d = Drain {}; | ||
| ^^^^^ not found in this scope | ||
help: possible candidates are found in other modules, you can import them into scope | ||
| | ||
LL | use crate::plumbing::Drain; | ||
| | ||
LL | use std::collections::binary_heap::Drain; | ||
| | ||
LL | use std::collections::hash_map::Drain; | ||
| | ||
LL | use std::collections::hash_set::Drain; | ||
| | ||
and 3 other candidates | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0422`. |