Skip to content

Commit

Permalink
nursery group -> style
Browse files Browse the repository at this point in the history
  • Loading branch information
1tgr committed Mar 23, 2020
1 parent de90924 commit 870b9e8
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 22 deletions.
5 changes: 3 additions & 2 deletions clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ pub mod zero_div_zero;
pub use crate::utils::conf::Conf;

mod reexport {
crate use rustc_ast::ast::Name;
pub use rustc_ast::ast::Name;
}

/// Register all pre expansion lints
Expand Down Expand Up @@ -1324,6 +1324,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&redundant_clone::REDUNDANT_CLONE),
LintId::of(&redundant_field_names::REDUNDANT_FIELD_NAMES),
LintId::of(&redundant_pattern_matching::REDUNDANT_PATTERN_MATCHING),
LintId::of(&redundant_pub_crate::REDUNDANT_PUB_CRATE),
LintId::of(&redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES),
LintId::of(&reference::DEREF_ADDROF),
LintId::of(&reference::REF_IN_DEREF),
Expand Down Expand Up @@ -1465,6 +1466,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&question_mark::QUESTION_MARK),
LintId::of(&redundant_field_names::REDUNDANT_FIELD_NAMES),
LintId::of(&redundant_pattern_matching::REDUNDANT_PATTERN_MATCHING),
LintId::of(&redundant_pub_crate::REDUNDANT_PUB_CRATE),
LintId::of(&redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES),
LintId::of(&regex::REGEX_MACRO),
LintId::of(&regex::TRIVIAL_REGEX),
Expand Down Expand Up @@ -1672,7 +1674,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&mutex_atomic::MUTEX_INTEGER),
LintId::of(&needless_borrow::NEEDLESS_BORROW),
LintId::of(&path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE),
LintId::of(&redundant_pub_crate::REDUNDANT_PUB_CRATE),
LintId::of(&use_self::USE_SELF),
]);
}
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/redundant_pub_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ declare_clippy_lint! {
/// }
/// ```
pub REDUNDANT_PUB_CRATE,
nursery,
style,
"Using `pub(crate)` visibility on items that are not crate visible due to the visibility of the module that contains them."
}

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/conf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ macro_rules! define_Conf {
$(
mod $config {
use serde::Deserialize;
crate fn deserialize<'de, D: serde::Deserializer<'de>>(deserializer: D) -> Result<$Ty, D::Error> {
pub fn deserialize<'de, D: serde::Deserializer<'de>>(deserializer: D) -> Result<$Ty, D::Error> {
use super::super::{ERRORS, Error};
Ok(
<$Ty>::deserialize(deserializer).unwrap_or_else(|e| {
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/utils/numeric_literal.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rustc_ast::ast::{Lit, LitFloatType, LitIntType, LitKind};

#[derive(Debug, PartialEq)]
pub(crate) enum Radix {
pub enum Radix {
Binary,
Octal,
Decimal,
Expand All @@ -26,7 +26,7 @@ pub fn format(lit: &str, type_suffix: Option<&str>, float: bool) -> String {
}

#[derive(Debug)]
pub(crate) struct NumericLiteral<'a> {
pub struct NumericLiteral<'a> {
/// Which radix the literal was represented in.
pub radix: Radix,
/// The radix prefix, if present.
Expand Down
2 changes: 1 addition & 1 deletion src/lintlist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1766,7 +1766,7 @@ pub const ALL_LINTS: [Lint; 362] = [
},
Lint {
name: "redundant_pub_crate",
group: "nursery",
group: "style",
desc: "Using `pub(crate)` visibility on items that are not crate visible due to the visibility of the module that contains them.",
deprecation: None,
module: "redundant_pub_crate",
Expand Down
1 change: 1 addition & 0 deletions tests/ui/wildcard_imports.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// aux-build:wildcard_imports_helper.rs

#![warn(clippy::wildcard_imports)]
#![allow(clippy::redundant_pub_crate)]
#![allow(unused)]
#![warn(unused_imports)]

Expand Down
1 change: 1 addition & 0 deletions tests/ui/wildcard_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// aux-build:wildcard_imports_helper.rs

#![warn(clippy::wildcard_imports)]
#![allow(clippy::redundant_pub_crate)]
#![allow(unused)]
#![warn(unused_imports)]

Expand Down
30 changes: 15 additions & 15 deletions tests/ui/wildcard_imports.stderr
Original file line number Diff line number Diff line change
@@ -1,91 +1,91 @@
error: usage of wildcard import
--> $DIR/wildcard_imports.rs:10:5
--> $DIR/wildcard_imports.rs:11:5
|
LL | use crate::fn_mod::*;
| ^^^^^^^^^^^^^^^^ help: try: `crate::fn_mod::foo`
|
= note: `-D clippy::wildcard-imports` implied by `-D warnings`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:11:5
--> $DIR/wildcard_imports.rs:12:5
|
LL | use crate::mod_mod::*;
| ^^^^^^^^^^^^^^^^^ help: try: `crate::mod_mod::inner_mod`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:12:5
--> $DIR/wildcard_imports.rs:13:5
|
LL | use crate::multi_fn_mod::*;
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_bar, multi_foo, multi_inner_mod}`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:14:5
--> $DIR/wildcard_imports.rs:15:5
|
LL | use crate::struct_mod::*;
| ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::struct_mod::{A, inner_struct_mod}`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:18:5
--> $DIR/wildcard_imports.rs:19:5
|
LL | use wildcard_imports_helper::inner::inner_for_self_import::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::inner::inner_for_self_import::inner_extern_bar`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:19:5
--> $DIR/wildcard_imports.rs:20:5
|
LL | use wildcard_imports_helper::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternA, extern_foo}`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:88:13
--> $DIR/wildcard_imports.rs:89:13
|
LL | use crate::fn_mod::*;
| ^^^^^^^^^^^^^^^^ help: try: `crate::fn_mod::foo`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:94:75
--> $DIR/wildcard_imports.rs:95:75
|
LL | use wildcard_imports_helper::inner::inner_for_self_import::{self, *};
| ^ help: try: `inner_extern_foo`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:95:13
--> $DIR/wildcard_imports.rs:96:13
|
LL | use wildcard_imports_helper::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternA, extern_foo}`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:106:20
--> $DIR/wildcard_imports.rs:107:20
|
LL | use self::{inner::*, inner2::*};
| ^^^^^^^^ help: try: `inner::inner_foo`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:106:30
--> $DIR/wildcard_imports.rs:107:30
|
LL | use self::{inner::*, inner2::*};
| ^^^^^^^^^ help: try: `inner2::inner_bar`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:113:13
--> $DIR/wildcard_imports.rs:114:13
|
LL | use wildcard_imports_helper::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternExportedEnum, ExternExportedStruct, extern_exported}`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:142:9
--> $DIR/wildcard_imports.rs:143:9
|
LL | use crate::in_fn_test::*;
| ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{ExportedEnum, ExportedStruct, exported}`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:151:9
--> $DIR/wildcard_imports.rs:152:9
|
LL | use crate:: in_fn_test:: * ;
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate:: in_fn_test::exported`

error: usage of wildcard import
--> $DIR/wildcard_imports.rs:152:9
--> $DIR/wildcard_imports.rs:153:9
|
LL | use crate:: fn_mod::
| _________^
Expand Down

0 comments on commit 870b9e8

Please sign in to comment.