-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 #80763 - petrochenkov:pubusecrate, r=estebank
resolve: Reduce scope of `pub_use_of_private_extern_crate` deprecation lint This lint was deny-by-default since July 2017, crater showed 7 uses on crates.io back then (#42894 (comment)). Unfortunately, the construction `pub use foo as bar` where `foo` is `extern crate foo;` was used by an older version `bitflags`, so turning it into an error causes too many regressions. So, this PR reduces the scope of the lint instead of turning it into a hard error, and only turns some more rarely used components of it into errors.
- Loading branch information
Showing
5 changed files
with
47 additions
and
36 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 |
---|---|---|
@@ -1,30 +1,37 @@ | ||
error: extern crate `core` is private, and cannot be re-exported (error E0365), consider declaring with `pub` | ||
--> $DIR/pub-reexport-priv-extern-crate.rs:4:9 | ||
error[E0603]: crate import `core` is private | ||
--> $DIR/pub-reexport-priv-extern-crate.rs:10:15 | ||
| | ||
LL | pub use core as reexported_core; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | use foo1::core; | ||
| ^^^^ private crate import | ||
| | ||
= note: `#[deny(pub_use_of_private_extern_crate)]` on by default | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> | ||
note: the crate import `core` is defined here | ||
--> $DIR/pub-reexport-priv-extern-crate.rs:6:5 | ||
| | ||
LL | extern crate core; | ||
| ^^^^^^^^^^^^^^^^^^ | ||
|
||
error: extern crate `core` is private, and cannot be re-exported (error E0365), consider declaring with `pub` | ||
--> $DIR/pub-reexport-priv-extern-crate.rs:12:9 | ||
error[E0603]: crate import `core` is private | ||
--> $DIR/pub-reexport-priv-extern-crate.rs:17:24 | ||
| | ||
LL | use foo1::core; | ||
| ^^^^^^^^^^ | ||
LL | pub use foo2::bar::core; | ||
| ^^^^ private crate import | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> | ||
note: the crate import `core` is defined here | ||
--> $DIR/pub-reexport-priv-extern-crate.rs:12:9 | ||
| | ||
LL | extern crate core; | ||
| ^^^^^^^^^^^^^^^^^^ | ||
|
||
error: extern crate `core` is private, and cannot be re-exported (error E0365), consider declaring with `pub` | ||
--> $DIR/pub-reexport-priv-extern-crate.rs:20:13 | ||
--> $DIR/pub-reexport-priv-extern-crate.rs:2:9 | ||
| | ||
LL | pub use foo2::bar::core; | ||
| ^^^^^^^^^^^^^^^ | ||
LL | pub use core as reexported_core; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `#[deny(pub_use_of_private_extern_crate)]` on by default | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0603`. |