Rename lint to better fit lint naming conventions

This commit is contained in:
blyxyas 2023-01-13 12:17:30 +01:00
parent 8ec9543f13
commit ade4c9b2b6
No known key found for this signature in database
GPG Key ID: 4D38170B5A2FC334
17 changed files with 20 additions and 19 deletions

View File

@ -4430,6 +4430,7 @@ Released 2018-09-13
[`if_same_then_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
[`if_then_some_else_none`]: https://rust-lang.github.io/rust-clippy/master/index.html#if_then_some_else_none
[`ifs_same_cond`]: https://rust-lang.github.io/rust-clippy/master/index.html#ifs_same_cond
[`impl_trait_in_params`]: https://rust-lang.github.io/rust-clippy/master/index.html#impl_trait_in_params
[`impl_trait_param`]: https://rust-lang.github.io/rust-clippy/master/index.html#impl_trait_param
[`implicit_clone`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
[`implicit_hasher`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_hasher

View File

@ -179,7 +179,7 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
crate::from_raw_with_void_ptr::FROM_RAW_WITH_VOID_PTR_INFO,
crate::from_str_radix_10::FROM_STR_RADIX_10_INFO,
crate::functions::DOUBLE_MUST_USE_INFO,
crate::functions::IMPL_TRAIT_PARAM_INFO,
crate::functions::IMPL_TRAIT_IN_PARAMS_INFO,
crate::functions::MISNAMED_GETTERS_INFO,
crate::functions::MUST_USE_CANDIDATE_INFO,
crate::functions::MUST_USE_UNIT_INFO,

View File

@ -4,7 +4,7 @@ use rustc_hir::{intravisit::FnKind, Body, Generics, HirId};
use rustc_lint::LateContext;
use rustc_span::Span;
use super::IMPL_TRAIT_PARAM;
use super::IMPL_TRAIT_IN_PARAMS;
pub(super) fn check_fn<'tcx>(cx: &LateContext<'_>, kind: &'tcx FnKind<'_>, body: &'tcx Body<'_>, hir_id: HirId) {
if cx.tcx.visibility(cx.tcx.hir().body_owner_def_id(body.id())).is_public() && !is_in_test_function(cx.tcx, hir_id)
@ -18,7 +18,7 @@ pub(super) fn check_fn<'tcx>(cx: &LateContext<'_>, kind: &'tcx FnKind<'_>, body:
// No generics with nested generics, and no generics like FnMut(x)
span_lint_and_then(
cx,
IMPL_TRAIT_PARAM,
IMPL_TRAIT_IN_PARAMS,
param.span,
&format!("'{}' in the function's parameters", param.name.ident().as_str()),
|diag| {

View File

@ -1,4 +1,4 @@
mod impl_trait_param;
mod impl_trait_in_params;
mod misnamed_getters;
mod must_use;
mod not_unsafe_ptr_arg_deref;
@ -349,7 +349,7 @@ declare_clippy_lint! {
/// }
/// ```
#[clippy::version = "1.68.0"]
pub IMPL_TRAIT_PARAM,
pub IMPL_TRAIT_IN_PARAMS,
style,
"`impl Trait` is used in the function's parameters"
}
@ -381,7 +381,7 @@ impl_lint_pass!(Functions => [
RESULT_UNIT_ERR,
RESULT_LARGE_ERR,
MISNAMED_GETTERS,
IMPL_TRAIT_PARAM,
IMPL_TRAIT_IN_PARAMS,
]);
impl<'tcx> LateLintPass<'tcx> for Functions {
@ -399,7 +399,7 @@ impl<'tcx> LateLintPass<'tcx> for Functions {
too_many_lines::check_fn(cx, kind, span, body, self.too_many_lines_threshold);
not_unsafe_ptr_arg_deref::check_fn(cx, kind, decl, body, def_id);
misnamed_getters::check_fn(cx, kind, decl, body, span);
impl_trait_param::check_fn(cx, &kind, body, hir_id);
impl_trait_in_params::check_fn(cx, &kind, body, hir_id);
}
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) {

View File

@ -6,7 +6,7 @@
clippy::similar_names,
clippy::wildcard_imports,
clippy::enum_glob_use,
clippy::impl_trait_param
clippy::impl_trait_in_params
)]
use crate::{both, over};

View File

@ -1,4 +1,4 @@
#![allow(clippy::impl_trait_param)]
#![allow(clippy::impl_trait_in_params)]
//! This module handles checking if the span given is from a proc-macro or not.
//!
//! Proc-macros are capable of setting the span of every token they output to a few possible spans.

View File

@ -1,4 +1,4 @@
#![allow(clippy::impl_trait_param)]
#![allow(clippy::impl_trait_in_params)]
use crate::consts::constant_simple;
use crate::macros::macro_backtrace;
use crate::source::snippet_opt;

View File

@ -1,4 +1,4 @@
#![allow(clippy::similar_names, clippy::impl_trait_param)] // `expr` and `expn`
#![allow(clippy::similar_names, clippy::impl_trait_in_params)] // `expr` and `expn`
use crate::source::snippet_opt;
use crate::visitors::{for_each_expr, Descend};

View File

@ -1,6 +1,6 @@
//! Utils for extracting, inspecting or transforming source code
#![allow(clippy::module_name_repetitions, clippy::impl_trait_param)]
#![allow(clippy::module_name_repetitions, clippy::impl_trait_in_params)]
use rustc_errors::Applicability;
use rustc_hir::{Expr, ExprKind};

View File

@ -1,6 +1,6 @@
#![deny(clippy::borrowed_box)]
#![allow(dead_code, unused_variables)]
#![allow(clippy::uninlined_format_args, clippy::disallowed_names, clippy::impl_trait_param)]
#![allow(clippy::uninlined_format_args, clippy::disallowed_names, clippy::impl_trait_in_params)]
use std::fmt::Display;

View File

@ -8,7 +8,7 @@
clippy::option_map_unit_fn,
clippy::redundant_closure_call,
clippy::uninlined_format_args,
clippy::impl_trait_param
clippy::impl_trait_in_params
)]
use std::path::{Path, PathBuf};

View File

@ -8,7 +8,7 @@
clippy::option_map_unit_fn,
clippy::redundant_closure_call,
clippy::uninlined_format_args,
clippy::impl_trait_param
clippy::impl_trait_in_params
)]
use std::path::{Path, PathBuf};

View File

@ -1,5 +1,5 @@
#![allow(unused)]
#![warn(clippy::impl_trait_param)]
#![warn(clippy::impl_trait_in_params)]
pub trait Trait {}

View File

@ -1,6 +1,6 @@
// run-rustfix
#![deny(clippy::trait_duplication_in_bounds)]
#![allow(clippy::impl_trait_param)]
#![allow(clippy::impl_trait_in_params)]
#![allow(unused)]
fn bad_foo<T: Clone + Copy, U: Clone + Copy>(arg0: T, argo1: U) {

View File

@ -1,6 +1,6 @@
// run-rustfix
#![deny(clippy::trait_duplication_in_bounds)]
#![allow(clippy::impl_trait_param)]
#![allow(clippy::impl_trait_in_params)]
#![allow(unused)]
fn bad_foo<T: Clone + Clone + Clone + Copy, U: Clone + Copy>(arg0: T, argo1: U) {

View File

@ -1,5 +1,5 @@
#![deny(clippy::trait_duplication_in_bounds)]
#![allow(clippy::impl_trait_param)]
#![allow(clippy::impl_trait_in_params)]
use std::collections::BTreeMap;
use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Sub, SubAssign};