forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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 rust-lang#112917 - chenyukang:yukang-fix-112590, r=este…
…bank Suggest importing for partial mod path matching in name resolving Fixes rust-lang#112590
- Loading branch information
Showing
10 changed files
with
174 additions
and
14 deletions.
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
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,13 @@ | ||
// edition:2018 | ||
|
||
// In this test baz isn't resolved when called as foo.baz even though | ||
// it's called from inside foo. This is somewhat surprising and may | ||
// want to change eventually. | ||
|
||
mod foo { | ||
pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of undeclared crate or module `foo` | ||
|
||
fn baz() { } | ||
} | ||
|
||
fn main() { } |
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,14 @@ | ||
error[E0433]: failed to resolve: use of undeclared crate or module `foo` | ||
--> $DIR/export-fully-qualified-2018.rs:8:20 | ||
| | ||
LL | pub fn bar() { foo::baz(); } | ||
| ^^^ use of undeclared crate or module `foo` | ||
| | ||
help: consider importing this module | ||
| | ||
LL + use crate::foo; | ||
| | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0433`. |
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
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,10 @@ | ||
pub struct S; | ||
|
||
impl fmt::Debug for S { //~ ERROR failed to resolve: use of undeclared crate or module `fmt` | ||
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { //~ ERROR failed to resolve: use of undeclared crate or module `fmt` | ||
//~^ ERROR failed to resolve: use of undeclared crate or module `fmt` | ||
Ok(()) | ||
} | ||
} | ||
|
||
fn main() { } |
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,36 @@ | ||
error[E0433]: failed to resolve: use of undeclared crate or module `fmt` | ||
--> $DIR/issue-112590-suggest-import.rs:3:6 | ||
| | ||
LL | impl fmt::Debug for S { | ||
| ^^^ use of undeclared crate or module `fmt` | ||
| | ||
help: consider importing this module | ||
| | ||
LL + use std::fmt; | ||
| | ||
|
||
error[E0433]: failed to resolve: use of undeclared crate or module `fmt` | ||
--> $DIR/issue-112590-suggest-import.rs:4:28 | ||
| | ||
LL | fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
| ^^^ use of undeclared crate or module `fmt` | ||
| | ||
help: consider importing this module | ||
| | ||
LL + use std::fmt; | ||
| | ||
|
||
error[E0433]: failed to resolve: use of undeclared crate or module `fmt` | ||
--> $DIR/issue-112590-suggest-import.rs:4:51 | ||
| | ||
LL | fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
| ^^^ use of undeclared crate or module `fmt` | ||
| | ||
help: consider importing this module | ||
| | ||
LL + use std::fmt; | ||
| | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0433`. |