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.
resolve: mark it undetermined if single import is not has any bindings
- Loading branch information
Showing
11 changed files
with
142 additions
and
41 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
//@ check-pass | ||
|
||
// https://github.com/rust-lang/rust/pull/124840#issuecomment-2098148587 | ||
|
||
mod a { | ||
pub(crate) use crate::S; | ||
} | ||
mod b { | ||
pub struct S; | ||
} | ||
use self::a::S; | ||
use self::b::*; | ||
|
||
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 @@ | ||
//@ check-pass | ||
|
||
// similar `cycle-import-in-diff-module-0.rs` | ||
|
||
mod a { | ||
pub(crate) use crate::s; | ||
} | ||
mod b { | ||
pub mod s {} | ||
} | ||
use self::b::*; | ||
use self::a::s; | ||
|
||
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,17 @@ | ||
// https://github.com/rust-lang/rust/issues/124490 | ||
|
||
mod a { | ||
pub mod b { | ||
pub mod c {} | ||
} | ||
} | ||
|
||
use a::*; | ||
|
||
use b::c; | ||
//~^ ERROR: cannot determine resolution for the import | ||
//~| ERROR: cannot determine resolution for the import | ||
//~| ERROR: unresolved import `b::c` | ||
use c as b; | ||
|
||
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,23 @@ | ||
error: cannot determine resolution for the import | ||
--> $DIR/shadow-glob-module-resolution-1.rs:11:5 | ||
| | ||
LL | use b::c; | ||
| ^^^^ | ||
|
||
error: cannot determine resolution for the import | ||
--> $DIR/shadow-glob-module-resolution-1.rs:11:5 | ||
| | ||
LL | use b::c; | ||
| ^^^^ | ||
| | ||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` | ||
|
||
error[E0432]: unresolved import `b::c` | ||
--> $DIR/shadow-glob-module-resolution-1.rs:11:5 | ||
| | ||
LL | use b::c; | ||
| ^^^^ | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
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,19 @@ | ||
// https://github.com/rust-lang/rust/issues/125013 | ||
|
||
mod a { | ||
pub mod b { | ||
pub mod c { | ||
pub trait D {} | ||
} | ||
} | ||
} | ||
|
||
use a::*; | ||
|
||
use e as b; | ||
//~^ ERROR: unresolved import `e` | ||
use b::c::D as e; | ||
//~^ ERROR: cannot determine resolution for the import | ||
//~| ERROR: cannot determine resolution for the import | ||
|
||
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,26 @@ | ||
error: cannot determine resolution for the import | ||
--> $DIR/shadow-glob-module-resolution-2.rs:15:5 | ||
| | ||
LL | use b::c::D as e; | ||
| ^^^^^^^^^^^^ | ||
|
||
error: cannot determine resolution for the import | ||
--> $DIR/shadow-glob-module-resolution-2.rs:15:5 | ||
| | ||
LL | use b::c::D as e; | ||
| ^^^^^^^^^^^^ | ||
| | ||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` | ||
|
||
error[E0432]: unresolved import `e` | ||
--> $DIR/shadow-glob-module-resolution-2.rs:13:5 | ||
| | ||
LL | use e as b; | ||
| -^^^^^ | ||
| | | ||
| no `e` in the root | ||
| help: a similar name exists in the module: `a` | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0432`. |