-
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.
Prohibit macro-expanded
extern crate
items shadowing crates passed …
…with `--extern`
- Loading branch information
1 parent
7976aa3
commit d1e337b
Showing
5 changed files
with
51 additions
and
5 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
13 changes: 11 additions & 2 deletions
13
src/test/ui/imports/extern-prelude-extern-crate-fail.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,9 +1,18 @@ | ||
error: macro-expanded `extern crate` items cannot shadow names passed with `--extern` | ||
--> $DIR/extern-prelude-extern-crate-fail.rs:16:9 | ||
| | ||
LL | extern crate std as non_existent; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
... | ||
LL | define_std_as_non_existent!(); | ||
| ------------------------------ in this macro invocation | ||
|
||
error[E0433]: failed to resolve. Use of undeclared type or module `two_macros` | ||
--> $DIR/extern-prelude-extern-crate-fail.rs:9:9 | ||
--> $DIR/extern-prelude-extern-crate-fail.rs:10:9 | ||
| | ||
LL | two_macros::m!(); //~ ERROR failed to resolve. Use of undeclared type or module `two_macros` | ||
| ^^^^^^^^^^ Use of undeclared type or module `two_macros` | ||
|
||
error: aborting due to previous error | ||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0433`. |