-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resolve: Fallback to extern crates in absolute paths on 2015 edition
- Loading branch information
1 parent
f613dc1
commit bd4a554
Showing
48 changed files
with
102 additions
and
199 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
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 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
40 changes: 0 additions & 40 deletions
40
src/test/ui/editions/edition-imports-virtual-2015-ambiguity.stderr
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 |
---|---|---|
@@ -1,12 +1,11 @@ | ||
// edition:2018 | ||
// aux-build:edition-imports-2015.rs | ||
// error-pattern: imports can only refer to extern crate names passed with `--extern` | ||
|
||
#[macro_use] | ||
extern crate edition_imports_2015; | ||
|
||
mod check { | ||
gen_gated!(); | ||
gen_gated!(); //~ ERROR unresolved import `E` | ||
} | ||
|
||
fn main() {} |
19 changes: 5 additions & 14 deletions
19
src/test/ui/editions/edition-imports-virtual-2015-gated.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 |
---|---|---|
@@ -1,20 +1,11 @@ | ||
error: imports can only refer to extern crate names passed with `--extern` in macros originating from 2015 edition | ||
--> <::edition_imports_2015::gen_gated macros>:1:50 | ||
error[E0432]: unresolved import `E` | ||
--> $DIR/edition-imports-virtual-2015-gated.rs:8:5 | ||
| | ||
LL | ( ) => { fn check_gated ( ) { enum E { A } use E :: * ; } } | ||
| ^ | ||
| | ||
::: $DIR/edition-imports-virtual-2015-gated.rs:9:5 | ||
LL | gen_gated!(); //~ ERROR unresolved import `E` | ||
| ^^^^^^^^^^^^^ could not find `E` in `{{root}}` | ||
| | ||
LL | gen_gated!(); | ||
| ------------- not an extern crate passed with `--extern` | ||
| | ||
note: this import refers to the enum defined here | ||
--> $DIR/edition-imports-virtual-2015-gated.rs:9:5 | ||
| | ||
LL | gen_gated!(); | ||
| ^^^^^^^^^^^^^ | ||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) | ||
|
||
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
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
5 changes: 3 additions & 2 deletions
5
src/test/ui/feature-gates/feature-gate-extern_absolute_paths.rs
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,5 +1,6 @@ | ||
use core::default; //~ ERROR unresolved import `core` | ||
use core::default; | ||
|
||
fn main() { | ||
let _: u8 = ::core::default::Default(); //~ ERROR failed to resolve | ||
let _: u8 = ::core::default::Default(); | ||
//~^ ERROR expected function, found trait `core::default::Default` | ||
} |
19 changes: 6 additions & 13 deletions
19
src/test/ui/feature-gates/feature-gate-extern_absolute_paths.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 |
---|---|---|
@@ -1,16 +1,9 @@ | ||
error[E0432]: unresolved import `core` | ||
--> $DIR/feature-gate-extern_absolute_paths.rs:1:5 | ||
error[E0423]: expected function, found trait `core::default::Default` | ||
--> $DIR/feature-gate-extern_absolute_paths.rs:4:17 | ||
| | ||
LL | use core::default; //~ ERROR unresolved import `core` | ||
| ^^^^ maybe a missing `extern crate core;`? | ||
LL | let _: u8 = ::core::default::Default(); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ not a function | ||
|
||
error[E0433]: failed to resolve: maybe a missing `extern crate core;`? | ||
--> $DIR/feature-gate-extern_absolute_paths.rs:4:19 | ||
| | ||
LL | let _: u8 = ::core::default::Default(); //~ ERROR failed to resolve | ||
| ^^^^ maybe a missing `extern crate core;`? | ||
|
||
error: aborting due to 2 previous errors | ||
error: aborting due to previous error | ||
|
||
Some errors occurred: E0432, E0433. | ||
For more information about an error, try `rustc --explain E0432`. | ||
For more information about this error, try `rustc --explain E0423`. |
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
Oops, something went wrong.