-
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.
Rollup merge of #67775 - mental32:master, r=Dylan-DPC
Make "use $crate" a hard error Closes #37390
- Loading branch information
Showing
5 changed files
with
15 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
// check-pass | ||
// aux-build:import_crate_var.rs | ||
|
||
#[macro_use] extern crate import_crate_var; | ||
|
||
fn main() { | ||
m!(); | ||
//~^ WARN `$crate` may not be imported | ||
//~| NOTE `use $crate;` was erroneously allowed and will become a hard error | ||
//~^ ERROR `$crate` may not be imported | ||
} |
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,10 @@ | ||
warning: `$crate` may not be imported | ||
--> $DIR/import-crate-var.rs:7:5 | ||
error: `$crate` may not be imported | ||
--> $DIR/import-crate-var.rs:6:5 | ||
| | ||
LL | m!(); | ||
| ^^^^^ | ||
| | ||
= note: `use $crate;` was erroneously allowed and will become a hard error in a future release | ||
= note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) | ||
= 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 | ||
|