forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#56211 - petrochenkov:fwd, r=petrochenkov
[master] Forward-ports from beta rust-lang#56206 + one commit from rust-lang#55884 that was accidentally missing in rust-lang#56042 due to an off-by-one mistake in commit ranges r? @ghost
- Loading branch information
Showing
9 changed files
with
129 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
pub mod issue_56125 {} | ||
|
||
pub mod last_segment { | ||
pub mod issue_56125 {} | ||
} | ||
|
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 |
---|---|---|
@@ -1,46 +1,67 @@ | ||
error[E0433]: failed to resolve: could not find `non_last_segment` in `issue_56125` | ||
--> $DIR/issue-56125.rs:8:18 | ||
--> $DIR/issue-56125.rs:14:22 | ||
| | ||
LL | use issue_56125::non_last_segment::non_last_segment::*; | ||
| ^^^^^^^^^^^^^^^^ could not find `non_last_segment` in `issue_56125` | ||
LL | use issue_56125::non_last_segment::non_last_segment::*; | ||
| ^^^^^^^^^^^^^^^^ could not find `non_last_segment` in `issue_56125` | ||
|
||
error[E0432]: unresolved import `issue_56125::last_segment` | ||
--> $DIR/issue-56125.rs:5:18 | ||
--> $DIR/issue-56125.rs:8:22 | ||
| | ||
LL | use issue_56125::last_segment::*; | ||
| ^^^^^^^^^^^^ could not find `last_segment` in `issue_56125` | ||
LL | use issue_56125::last_segment::*; | ||
| ^^^^^^^^^^^^ could not find `last_segment` in `issue_56125` | ||
|
||
error[E0432]: unresolved import `empty::issue_56125` | ||
--> $DIR/issue-56125.rs:21:9 | ||
| | ||
LL | use empty::issue_56125; //~ ERROR unresolved import `empty::issue_56125` | ||
| ^^^^^^^^^^^^^^^^^^ no `issue_56125` in `m3::empty` | ||
|
||
error[E0659]: `issue_56125` is ambiguous (name vs any other name during import resolution) | ||
--> $DIR/issue-56125.rs:5:5 | ||
--> $DIR/issue-56125.rs:8:9 | ||
| | ||
LL | use issue_56125::last_segment::*; | ||
| ^^^^^^^^^^^ ambiguous name | ||
LL | use issue_56125::last_segment::*; | ||
| ^^^^^^^^^^^ ambiguous name | ||
| | ||
= note: `issue_56125` could refer to an extern crate passed with `--extern` | ||
= help: use `::issue_56125` to refer to this extern crate unambiguously | ||
note: `issue_56125` could also refer to the module imported here | ||
--> $DIR/issue-56125.rs:5:5 | ||
--> $DIR/issue-56125.rs:8:9 | ||
| | ||
LL | use issue_56125::last_segment::*; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | use issue_56125::last_segment::*; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= help: use `self::issue_56125` to refer to this module unambiguously | ||
|
||
error[E0659]: `issue_56125` is ambiguous (name vs any other name during import resolution) | ||
--> $DIR/issue-56125.rs:8:5 | ||
--> $DIR/issue-56125.rs:14:9 | ||
| | ||
LL | use issue_56125::non_last_segment::non_last_segment::*; | ||
| ^^^^^^^^^^^ ambiguous name | ||
LL | use issue_56125::non_last_segment::non_last_segment::*; | ||
| ^^^^^^^^^^^ ambiguous name | ||
| | ||
= note: `issue_56125` could refer to an extern crate passed with `--extern` | ||
= help: use `::issue_56125` to refer to this extern crate unambiguously | ||
note: `issue_56125` could also refer to the module imported here | ||
--> $DIR/issue-56125.rs:5:5 | ||
--> $DIR/issue-56125.rs:14:9 | ||
| | ||
LL | use issue_56125::last_segment::*; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | use issue_56125::non_last_segment::non_last_segment::*; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= help: use `self::issue_56125` to refer to this module unambiguously | ||
|
||
error: aborting due to 4 previous errors | ||
error[E0659]: `issue_56125` is ambiguous (name vs any other name during import resolution) | ||
--> $DIR/issue-56125.rs:22:9 | ||
| | ||
LL | use issue_56125::*; //~ ERROR `issue_56125` is ambiguous | ||
| ^^^^^^^^^^^ ambiguous name | ||
| | ||
= note: `issue_56125` could refer to an extern crate passed with `--extern` | ||
= help: use `::issue_56125` to refer to this extern crate unambiguously | ||
note: `issue_56125` could also refer to the unresolved item imported here | ||
--> $DIR/issue-56125.rs:21:9 | ||
| | ||
LL | use empty::issue_56125; //~ ERROR unresolved import `empty::issue_56125` | ||
| ^^^^^^^^^^^^^^^^^^ | ||
= help: use `self::issue_56125` to refer to this unresolved item unambiguously | ||
|
||
error: aborting due to 6 previous errors | ||
|
||
Some errors occurred: E0432, E0433, E0659. | ||
For more information about an 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 |
---|---|---|
|
@@ -19,4 +19,7 @@ use foo as self; | |
|
||
use foo::self; | ||
|
||
use foo::A; | ||
use foo::{self as A}; | ||
|
||
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
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 | ||
|
||
mod m { | ||
pub(in crate) struct S1; // OK | ||
pub(in super) struct S2; // OK | ||
pub(in self) struct S3; // OK | ||
pub(in ::core) struct S4; | ||
//~^ ERROR visibilities can only be restricted to ancestor modules | ||
pub(in a::b) struct S5; | ||
//~^ ERROR relative paths are not supported in visibilities on 2018 edition | ||
} | ||
|
||
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,16 @@ | ||
error: visibilities can only be restricted to ancestor modules | ||
--> $DIR/relative-2018.rs:7:12 | ||
| | ||
LL | pub(in ::core) struct S4; | ||
| ^^^^^^ | ||
|
||
error: relative paths are not supported in visibilities on 2018 edition | ||
--> $DIR/relative-2018.rs:9:12 | ||
| | ||
LL | pub(in a::b) struct S5; | ||
| ^--- | ||
| | | ||
| help: try: `crate::a::b` | ||
|
||
error: aborting due to 2 previous errors | ||
|