-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a couple more tests + address review comments
- Loading branch information
1 parent
5946470
commit 139d109
Showing
14 changed files
with
161 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
mod m1 { | ||
pub fn f() {} | ||
} | ||
mod m2 { | ||
pub fn f(_: u8) {} | ||
} | ||
|
||
pub use m1::*; | ||
pub use m2::*; |
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,7 @@ | ||
// aux-build:glob-conflict.rs | ||
|
||
extern crate glob_conflict; | ||
|
||
fn main() { | ||
glob_conflict::f(); //~ ERROR cannot find function `f` in module `glob_conflict` | ||
} |
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,9 @@ | ||
error[E0425]: cannot find function `f` in module `glob_conflict` | ||
--> $DIR/glob-conflict-cross-crate.rs:6:20 | ||
| | ||
LL | glob_conflict::f(); //~ ERROR cannot find function `f` in module `glob_conflict` | ||
| ^ not found in `glob_conflict` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0425`. |
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,21 @@ | ||
mod m { | ||
mod m1 { | ||
pub struct S {} | ||
} | ||
mod m2 { | ||
// Note this derive, it makes this struct macro-expanded, | ||
// so it doesn't appear in time to participate in the initial resolution of `use m::S`, | ||
// only in the later validation pass. | ||
#[derive(Default)] | ||
pub struct S {} | ||
} | ||
|
||
// Create a glob vs glob ambiguity | ||
pub use self::m1::*; | ||
pub use self::m2::*; | ||
} | ||
|
||
fn main() { | ||
use m::S; //~ ERROR `S` is ambiguous | ||
let s = S {}; | ||
} |
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,22 @@ | ||
error[E0659]: `S` is ambiguous (glob import vs glob import in the same module) | ||
--> $DIR/issue-55884-1.rs:19:12 | ||
| | ||
LL | use m::S; //~ ERROR `S` is ambiguous | ||
| ^ ambiguous name | ||
| | ||
note: `S` could refer to the struct imported here | ||
--> $DIR/issue-55884-1.rs:14:13 | ||
| | ||
LL | pub use self::m1::*; | ||
| ^^^^^^^^^^^ | ||
= help: consider adding an explicit import of `S` to disambiguate | ||
note: `S` could also refer to the struct imported here | ||
--> $DIR/issue-55884-1.rs:15:13 | ||
| | ||
LL | pub use self::m2::*; | ||
| ^^^^^^^^^^^ | ||
= help: consider adding an explicit import of `S` to disambiguate | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0659`. |
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 @@ | ||
mod options { | ||
pub struct ParseOptions {} | ||
} | ||
|
||
mod parser { | ||
pub use options::*; | ||
// Private single import shadows public glob import, but arrives too late for initial | ||
// resolution of `use parser::ParseOptions` because it depends on that resolution itself. | ||
use ParseOptions; | ||
} | ||
|
||
pub use parser::ParseOptions; //~ ERROR struct `ParseOptions` is private | ||
|
||
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,9 @@ | ||
error[E0603]: struct `ParseOptions` is private | ||
--> $DIR/issue-55884-2.rs:12:17 | ||
| | ||
LL | pub use parser::ParseOptions; //~ ERROR struct `ParseOptions` is private | ||
| ^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0603`. |
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,7 @@ | ||
// edition:2018 | ||
// compile-flags:--extern foo --extern bar | ||
|
||
use foo::bar; //~ ERROR unresolved import | ||
use bar::foo; | ||
|
||
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,9 @@ | ||
error[E0432]: unresolved import | ||
--> $DIR/deadlock.rs:4:5 | ||
| | ||
LL | use foo::bar; //~ ERROR unresolved import | ||
| ^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0432`. |
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,11 @@ | ||
// edition:2018 | ||
|
||
#![deny(unused)] | ||
|
||
use std::fmt; | ||
|
||
// No "unresolved import" + "unused import" combination here. | ||
use fmt::Write; //~ ERROR imports can only refer to extern crate names | ||
//~| ERROR unused import: `fmt::Write` | ||
|
||
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,32 @@ | ||
error[E0658]: imports can only refer to extern crate names passed with `--extern` on stable channel (see issue #53130) | ||
--> $DIR/issue-54390.rs:8:5 | ||
| | ||
LL | use std::fmt; | ||
| -------- not an extern crate passed with `--extern` | ||
... | ||
LL | use fmt::Write; //~ ERROR imports can only refer to extern crate names | ||
| ^^^ | ||
| | ||
= help: add #![feature(uniform_paths)] to the crate attributes to enable | ||
note: this import refers to the module imported here | ||
--> $DIR/issue-54390.rs:5:5 | ||
| | ||
LL | use std::fmt; | ||
| ^^^^^^^^ | ||
|
||
error: unused import: `fmt::Write` | ||
--> $DIR/issue-54390.rs:8:5 | ||
| | ||
LL | use fmt::Write; //~ ERROR imports can only refer to extern crate names | ||
| ^^^^^^^^^^ | ||
| | ||
note: lint level defined here | ||
--> $DIR/issue-54390.rs:3:9 | ||
| | ||
LL | #![deny(unused)] | ||
| ^^^^^^ | ||
= note: #[deny(unused_imports)] implied by #[deny(unused)] | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |