mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 16:39:26 +00:00
Change category and update to ui_test
This commit is contained in:
parent
8296a338db
commit
46aa8abf08
7 changed files with 15 additions and 11 deletions
|
@ -23,16 +23,18 @@ declare_clippy_lint! {
|
|||
/// ```
|
||||
#[clippy::version = "1.72.0"]
|
||||
pub NEEDLESS_PUB_SELF,
|
||||
complexity,
|
||||
style,
|
||||
"checks for usage of `pub(self)` and `pub(in self)`."
|
||||
}
|
||||
declare_clippy_lint! {
|
||||
/// ### What it does
|
||||
/// Checks for missing usage of the `pub(in <loc>)` shorthand.
|
||||
/// Checks for usage of `pub(<loc>)` with `in`.
|
||||
///
|
||||
/// ### Why is this bad?
|
||||
/// Consistency. Use it or don't, just be consistent about it.
|
||||
///
|
||||
/// Also see the `pub_without_shorthand` lint for an alternative.
|
||||
///
|
||||
/// ### Example
|
||||
/// ```rust,ignore
|
||||
/// pub(super) type OptBox<T> = Option<Box<T>>;
|
||||
|
@ -44,11 +46,11 @@ declare_clippy_lint! {
|
|||
#[clippy::version = "1.72.0"]
|
||||
pub PUB_WITH_SHORTHAND,
|
||||
restriction,
|
||||
"disallows usage of the `pub(<loc>)`, suggesting use of the `in` shorthand"
|
||||
"disallows usage of `pub(<loc>)`, without `in`"
|
||||
}
|
||||
declare_clippy_lint! {
|
||||
/// ### What it does
|
||||
/// Checks for usage of the `pub(in <loc>)` shorthand.
|
||||
/// Checks for usage of `pub(<loc>)` without `in`.
|
||||
///
|
||||
/// Note: As you cannot write a module's path in `pub(<loc>)`, this will only trigger on
|
||||
/// `pub(super)` and the like.
|
||||
|
@ -56,6 +58,8 @@ declare_clippy_lint! {
|
|||
/// ### Why is this bad?
|
||||
/// Consistency. Use it or don't, just be consistent about it.
|
||||
///
|
||||
/// Also see the `pub_with_shorthand` lint for an alternative.
|
||||
///
|
||||
/// ### Example
|
||||
/// ```rust,ignore
|
||||
/// pub(in super) type OptBox<T> = Option<Box<T>>;
|
||||
|
@ -67,7 +71,7 @@ declare_clippy_lint! {
|
|||
#[clippy::version = "1.72.0"]
|
||||
pub PUB_WITHOUT_SHORTHAND,
|
||||
restriction,
|
||||
"disallows usage of the `pub(in <loc>)` shorthand wherever possible"
|
||||
"disallows usage of `pub(in <loc>)` with `in`"
|
||||
}
|
||||
declare_lint_pass!(Visibility => [NEEDLESS_PUB_SELF, PUB_WITH_SHORTHAND, PUB_WITHOUT_SHORTHAND]);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//@run-rustfix
|
||||
//@aux-build:proc_macros.rs
|
||||
//@aux-build:proc_macros.rs:proc-macro
|
||||
#![feature(custom_inner_attributes)]
|
||||
#![allow(unused)]
|
||||
#![warn(clippy::needless_pub_self)]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//@run-rustfix
|
||||
//@aux-build:proc_macros.rs
|
||||
//@aux-build:proc_macros.rs:proc-macro
|
||||
#![feature(custom_inner_attributes)]
|
||||
#![allow(unused)]
|
||||
#![warn(clippy::needless_pub_self)]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//@run-rustfix
|
||||
//@aux-build:proc_macros.rs
|
||||
//@aux-build:proc_macros.rs:proc-macro
|
||||
#![feature(custom_inner_attributes)]
|
||||
#![allow(clippy::needless_pub_self, unused)]
|
||||
#![warn(clippy::pub_with_shorthand)]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//@run-rustfix
|
||||
//@aux-build:proc_macros.rs
|
||||
//@aux-build:proc_macros.rs:proc-macro
|
||||
#![feature(custom_inner_attributes)]
|
||||
#![allow(clippy::needless_pub_self, unused)]
|
||||
#![warn(clippy::pub_with_shorthand)]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//@run-rustfix
|
||||
//@aux-build:proc_macros.rs
|
||||
//@aux-build:proc_macros.rs:proc-macro
|
||||
#![feature(custom_inner_attributes)]
|
||||
#![allow(clippy::needless_pub_self, unused)]
|
||||
#![warn(clippy::pub_without_shorthand)]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//@run-rustfix
|
||||
//@aux-build:proc_macros.rs
|
||||
//@aux-build:proc_macros.rs:proc-macro
|
||||
#![feature(custom_inner_attributes)]
|
||||
#![allow(clippy::needless_pub_self, unused)]
|
||||
#![warn(clippy::pub_without_shorthand)]
|
||||
|
|
Loading…
Reference in a new issue