-
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.
privacy: Feature gate new type privacy lints
- Loading branch information
1 parent
f9097f8
commit d326aed
Showing
17 changed files
with
149 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1555,6 +1555,7 @@ symbols! { | |
type_length_limit, | ||
type_macros, | ||
type_name, | ||
type_privacy_lints, | ||
u128, | ||
u16, | ||
u32, | ||
|
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,3 +1,4 @@ | ||
#![feature(type_privacy_lints)] | ||
#[warn(private_bounds)] | ||
#[warn(private_interfaces)] | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// check-pass | ||
|
||
#![warn(private_interfaces)] //~ WARN unknown lint | ||
//~| WARN unknown lint | ||
//~| WARN unknown lint | ||
#![warn(private_bounds)] //~ WARN unknown lint | ||
//~| WARN unknown lint | ||
//~| WARN unknown lint | ||
#![warn(unnameable_types)] //~ WARN unknown lint | ||
//~| WARN unknown lint | ||
//~| WARN unknown lint | ||
fn main() {} |
93 changes: 93 additions & 0 deletions
93
tests/ui/feature-gates/feature-gate-type_privacy_lints.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 |
---|---|---|
@@ -0,0 +1,93 @@ | ||
warning: unknown lint: `private_interfaces` | ||
--> $DIR/feature-gate-type_privacy_lints.rs:3:1 | ||
| | ||
LL | #![warn(private_interfaces)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the `private_interfaces` lint is unstable | ||
= note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information | ||
= help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable | ||
= note: `#[warn(unknown_lints)]` on by default | ||
|
||
warning: unknown lint: `private_bounds` | ||
--> $DIR/feature-gate-type_privacy_lints.rs:6:1 | ||
| | ||
LL | #![warn(private_bounds)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the `private_bounds` lint is unstable | ||
= note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information | ||
= help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable | ||
|
||
warning: unknown lint: `unnameable_types` | ||
--> $DIR/feature-gate-type_privacy_lints.rs:9:1 | ||
| | ||
LL | #![warn(unnameable_types)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the `unnameable_types` lint is unstable | ||
= note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information | ||
= help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable | ||
|
||
warning: unknown lint: `private_interfaces` | ||
--> $DIR/feature-gate-type_privacy_lints.rs:3:1 | ||
| | ||
LL | #![warn(private_interfaces)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the `private_interfaces` lint is unstable | ||
= note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information | ||
= help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable | ||
|
||
warning: unknown lint: `private_bounds` | ||
--> $DIR/feature-gate-type_privacy_lints.rs:6:1 | ||
| | ||
LL | #![warn(private_bounds)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the `private_bounds` lint is unstable | ||
= note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information | ||
= help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable | ||
|
||
warning: unknown lint: `unnameable_types` | ||
--> $DIR/feature-gate-type_privacy_lints.rs:9:1 | ||
| | ||
LL | #![warn(unnameable_types)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the `unnameable_types` lint is unstable | ||
= note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information | ||
= help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable | ||
|
||
warning: unknown lint: `private_interfaces` | ||
--> $DIR/feature-gate-type_privacy_lints.rs:3:1 | ||
| | ||
LL | #![warn(private_interfaces)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the `private_interfaces` lint is unstable | ||
= note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information | ||
= help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable | ||
|
||
warning: unknown lint: `private_bounds` | ||
--> $DIR/feature-gate-type_privacy_lints.rs:6:1 | ||
| | ||
LL | #![warn(private_bounds)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the `private_bounds` lint is unstable | ||
= note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information | ||
= help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable | ||
|
||
warning: unknown lint: `unnameable_types` | ||
--> $DIR/feature-gate-type_privacy_lints.rs:9:1 | ||
| | ||
LL | #![warn(unnameable_types)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the `unnameable_types` lint is unstable | ||
= note: see issue #48054 <https://github.com/rust-lang/rust/issues/48054> for more information | ||
= help: add `#![feature(type_privacy_lints)]` to the crate attributes to enable | ||
|
||
warning: 9 warnings emitted | ||
|
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,4 +1,4 @@ | ||
#![allow(unused)] | ||
#![feature(type_privacy_lints)] | ||
#![allow(private_in_public)] | ||
#![deny(unnameable_types)] | ||
|
||
|
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
1 change: 1 addition & 0 deletions
1
tests/ui/pub/issue-33174-restricted-type-in-public-interface.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
Oops, something went wrong.