Skip to content

Commit 46aa8ab

Browse files
committed
Change category and update to ui_test
1 parent 8296a33 commit 46aa8ab

File tree

7 files changed

+15
-11
lines changed

7 files changed

+15
-11
lines changed

clippy_lints/src/visibility.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,18 @@ declare_clippy_lint! {
2323
/// ```
2424
#[clippy::version = "1.72.0"]
2525
pub NEEDLESS_PUB_SELF,
26-
complexity,
26+
style,
2727
"checks for usage of `pub(self)` and `pub(in self)`."
2828
}
2929
declare_clippy_lint! {
3030
/// ### What it does
31-
/// Checks for missing usage of the `pub(in <loc>)` shorthand.
31+
/// Checks for usage of `pub(<loc>)` with `in`.
3232
///
3333
/// ### Why is this bad?
3434
/// Consistency. Use it or don't, just be consistent about it.
3535
///
36+
/// Also see the `pub_without_shorthand` lint for an alternative.
37+
///
3638
/// ### Example
3739
/// ```rust,ignore
3840
/// pub(super) type OptBox<T> = Option<Box<T>>;
@@ -44,18 +46,20 @@ declare_clippy_lint! {
4446
#[clippy::version = "1.72.0"]
4547
pub PUB_WITH_SHORTHAND,
4648
restriction,
47-
"disallows usage of the `pub(<loc>)`, suggesting use of the `in` shorthand"
49+
"disallows usage of `pub(<loc>)`, without `in`"
4850
}
4951
declare_clippy_lint! {
5052
/// ### What it does
51-
/// Checks for usage of the `pub(in <loc>)` shorthand.
53+
/// Checks for usage of `pub(<loc>)` without `in`.
5254
///
5355
/// Note: As you cannot write a module's path in `pub(<loc>)`, this will only trigger on
5456
/// `pub(super)` and the like.
5557
///
5658
/// ### Why is this bad?
5759
/// Consistency. Use it or don't, just be consistent about it.
5860
///
61+
/// Also see the `pub_with_shorthand` lint for an alternative.
62+
///
5963
/// ### Example
6064
/// ```rust,ignore
6165
/// pub(in super) type OptBox<T> = Option<Box<T>>;
@@ -67,7 +71,7 @@ declare_clippy_lint! {
6771
#[clippy::version = "1.72.0"]
6872
pub PUB_WITHOUT_SHORTHAND,
6973
restriction,
70-
"disallows usage of the `pub(in <loc>)` shorthand wherever possible"
74+
"disallows usage of `pub(in <loc>)` with `in`"
7175
}
7276
declare_lint_pass!(Visibility => [NEEDLESS_PUB_SELF, PUB_WITH_SHORTHAND, PUB_WITHOUT_SHORTHAND]);
7377

tests/ui/needless_pub_self.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@run-rustfix
2-
//@aux-build:proc_macros.rs
2+
//@aux-build:proc_macros.rs:proc-macro
33
#![feature(custom_inner_attributes)]
44
#![allow(unused)]
55
#![warn(clippy::needless_pub_self)]

tests/ui/needless_pub_self.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@run-rustfix
2-
//@aux-build:proc_macros.rs
2+
//@aux-build:proc_macros.rs:proc-macro
33
#![feature(custom_inner_attributes)]
44
#![allow(unused)]
55
#![warn(clippy::needless_pub_self)]

tests/ui/pub_with_shorthand.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@run-rustfix
2-
//@aux-build:proc_macros.rs
2+
//@aux-build:proc_macros.rs:proc-macro
33
#![feature(custom_inner_attributes)]
44
#![allow(clippy::needless_pub_self, unused)]
55
#![warn(clippy::pub_with_shorthand)]

tests/ui/pub_with_shorthand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@run-rustfix
2-
//@aux-build:proc_macros.rs
2+
//@aux-build:proc_macros.rs:proc-macro
33
#![feature(custom_inner_attributes)]
44
#![allow(clippy::needless_pub_self, unused)]
55
#![warn(clippy::pub_with_shorthand)]

tests/ui/pub_without_shorthand.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@run-rustfix
2-
//@aux-build:proc_macros.rs
2+
//@aux-build:proc_macros.rs:proc-macro
33
#![feature(custom_inner_attributes)]
44
#![allow(clippy::needless_pub_self, unused)]
55
#![warn(clippy::pub_without_shorthand)]

tests/ui/pub_without_shorthand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@run-rustfix
2-
//@aux-build:proc_macros.rs
2+
//@aux-build:proc_macros.rs:proc-macro
33
#![feature(custom_inner_attributes)]
44
#![allow(clippy::needless_pub_self, unused)]
55
#![warn(clippy::pub_without_shorthand)]

0 commit comments

Comments
 (0)