-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resolve: Support aliasing local crate root in extern prelude
- Loading branch information
1 parent
d3ed348
commit 549bd45
Showing
9 changed files
with
89 additions
and
10 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
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,3 @@ | ||
extern crate self as foo; //~ ERROR `extern crate self` is unstable | ||
|
||
fn main() {} |
11 changes: 11 additions & 0 deletions
11
src/test/ui/feature-gates/feature-gate-extern_crate_self.stderr
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 @@ | ||
error[E0658]: `extern crate self` is unstable (see issue #54658) | ||
--> $DIR/feature-gate-extern_crate_self.rs:1:1 | ||
| | ||
LL | extern crate self as foo; //~ ERROR `extern crate self` is unstable | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: add #![feature(extern_crate_self)] to the crate attributes to enable | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
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,8 @@ | ||
#![feature(extern_crate_self)] | ||
|
||
extern crate self; //~ ERROR `extern crate self;` requires renaming | ||
|
||
#[macro_use] //~ ERROR `macro_use` is not supported on `extern crate self` | ||
extern crate self as 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,14 @@ | ||
error: `extern crate self;` requires renaming | ||
--> $DIR/extern-crate-self-fail.rs:3:1 | ||
| | ||
LL | extern crate self; //~ ERROR `extern crate self;` requires renaming | ||
| ^^^^^^^^^^^^^^^^^^ help: try: `extern crate self as name;` | ||
|
||
error: `macro_use` is not supported on `extern crate self` | ||
--> $DIR/extern-crate-self-fail.rs:5:1 | ||
| | ||
LL | #[macro_use] //~ ERROR `macro_use` is not supported on `extern crate self` | ||
| ^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
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,15 @@ | ||
// compile-pass | ||
|
||
#![feature(extern_crate_self)] | ||
|
||
extern crate self as foo; | ||
|
||
struct S; | ||
|
||
mod m { | ||
fn check() { | ||
foo::S; // OK | ||
} | ||
} | ||
|
||
fn main() {} |