nursery group -> style

This commit is contained in:
Tim Robinson 2020-03-23 16:06:15 +00:00
parent de9092438d
commit 870b9e8139
8 changed files with 25 additions and 22 deletions

View File

@ -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
@ -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),
@ -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),
@ -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),
]);
}

View File

@ -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."
}

View File

@ -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| {

View File

@ -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,
@ -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.

View File

@ -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",

View File

@ -2,6 +2,7 @@
// aux-build:wildcard_imports_helper.rs
#![warn(clippy::wildcard_imports)]
#![allow(clippy::redundant_pub_crate)]
#![allow(unused)]
#![warn(unused_imports)]

View File

@ -2,6 +2,7 @@
// aux-build:wildcard_imports_helper.rs
#![warn(clippy::wildcard_imports)]
#![allow(clippy::redundant_pub_crate)]
#![allow(unused)]
#![warn(unused_imports)]

View File

@ -1,5 +1,5 @@
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`
@ -7,85 +7,85 @@ LL | use crate::fn_mod::*;
= 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::
| _________^