-
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.
Auto merge of #56032 - petrochenkov:stabecip, r=nikomatsakis
Stabilize `extern_crate_item_prelude` Closes #55599
- Loading branch information
Showing
13 changed files
with
40 additions
and
151 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
2 changes: 0 additions & 2 deletions
2
src/test/ui-fulldeps/proc-macro/extern-prelude-extern-crate-proc-macro.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
46 changes: 0 additions & 46 deletions
46
src/test/ui/feature-gates/feature-gate-extern_crate_item_prelude.rs
This file was deleted.
Oops, something went wrong.
75 changes: 0 additions & 75 deletions
75
src/test/ui/feature-gates/feature-gate-extern_crate_item_prelude.stderr
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
src/test/ui/imports/extern-prelude-extern-crate-absolute-expanded.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
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
15 changes: 12 additions & 3 deletions
15
src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.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,19 +1,28 @@ | ||
error: macro-expanded `extern crate` items cannot shadow names passed with `--extern` | ||
--> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:19:9 | ||
| | ||
LL | extern crate std as core; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
... | ||
LL | define_other_core!(); | ||
| --------------------- in this macro invocation | ||
|
||
error[E0659]: `Vec` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) | ||
--> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:15:9 | ||
--> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:13:9 | ||
| | ||
LL | Vec::panic!(); //~ ERROR `Vec` is ambiguous | ||
| ^^^ ambiguous name | ||
| | ||
= note: `Vec` could refer to a struct from prelude | ||
note: `Vec` could also refer to the extern crate imported here | ||
--> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:7:9 | ||
--> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:5:9 | ||
| | ||
LL | extern crate std as Vec; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
... | ||
LL | define_vec!(); | ||
| -------------- in this macro invocation | ||
|
||
error: aborting due to previous error | ||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0659`. |
12 changes: 12 additions & 0 deletions
12
src/test/ui/imports/extern-prelude-extern-crate-shadowing.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// compile-pass | ||
// aux-build:two_macros.rs | ||
|
||
extern crate two_macros as core; | ||
|
||
mod m { | ||
fn check() { | ||
core::m!(); // OK | ||
} | ||
} | ||
|
||
fn main() {} |