Skip to content
Merged

Clippyup #92849

Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
1788cfd
Remove NullOp::Box
nbdd0121 Sep 26, 2021
d5cbae9
fix clippy
lcnr Dec 23, 2021
dfd3254
Update pulldown-cmark version in clippy
GuillaumeGomez Dec 28, 2021
828ddbe
fix [`redundant_closure`] fp with `Arc`
ebobrow Dec 29, 2021
97ab44c
Merge commit '0eff589afc83e21a03a168497bbab6b4dfbb4ef6' into clippyup
flip1995 Dec 30, 2021
2b5257e
Remove method_call! macro
camsteffen Dec 30, 2021
1f3d6a6
Auto merge of #92252 - GuillaumeGomez:update-pulldown, r=camelid,xFre…
bors Dec 31, 2021
65d1f83
Extend [`unused_io_amount`] to cover AsyncRead and AsyncWrite.
nmathewson Dec 27, 2021
b6bcf0c
unused_io_amount: Use span_lint_and_help.
nmathewson Dec 31, 2021
490566b
Auto merge of #8179 - nmathewson:unused_async_io_amount, r=xFrednet
bors Dec 31, 2021
c736a63
Auto merge of #8193 - ebobrow:redundant_closure_fp, r=Manishearth
bors Dec 31, 2021
3d41358
wrong_self_convention: Match `SelfKind::No` more restrictively
nmathewson Jan 1, 2022
f5bbd1b
Make tidy check for magic numbers that spell things
joshtriplett Jan 1, 2022
262b148
return_self_not_must_use document `#[must_use]` on the type
bors Jan 1, 2022
7616eb0
Auto merge of #8209 - xFrednet:8197-mention-attribute-on-struct, r=ll…
bors Jan 1, 2022
b25dbc6
Auto merge of #8208 - nmathewson:selfkind_no_fix, r=xFrednet
bors Jan 2, 2022
e8b6b2a
erasing_op lint ignored when output type is different from the non-co…
Dec 31, 2021
8419108
Auto merge of #8204 - wigy-opensource-developer:fix-7210, r=xFrednet
bors Jan 2, 2022
6975071
Rollup merge of #90102 - nbdd0121:box3, r=jonas-schievink
matthiaskrgr Jan 3, 2022
19cfcd5
Fix clippy warnings
pmnoxx Jan 3, 2022
3ea7784
Auto merge of #8216 - pmnoxx:piotr-fix-clippy-warnings, r=xFrednet
bors Jan 3, 2022
ff58efb
Better detect when a field can be moved from in `while_let_on_iterator`
Jarcho Jan 4, 2022
00da1b8
Remove in_macro from utils
camsteffen Jan 4, 2022
a7097b8
Consider auto-deref when linting `manual_swap`
Jarcho Jan 4, 2022
0e28e38
Auto merge of #8220 - Jarcho:manual_swap_8154, r=camsteffen
bors Jan 4, 2022
2dd216a
Check for full equality in `type_repetition_in_bounds` rather than ju…
Jarcho Jan 4, 2022
d7a6033
Rollup merge of #91907 - lcnr:const-arg-infer, r=BoxyUwU
matthiaskrgr Jan 4, 2022
786f874
New macro utils
bors Jan 4, 2022
ba03dc7
Auto merge of #8219 - camsteffen:macro-decoupling, r=llogiq
bors Jan 4, 2022
d5dcda2
Auto merge of #8223 - camsteffen:remove-in-macro, r=llogiq
bors Jan 5, 2022
20f2a89
Auto merge of #8224 - Jarcho:type_repetition_in_bounds_8162, r=llogiq
bors Jan 5, 2022
92048f4
Auto merge of #8221 - Jarcho:while_let_on_iterator_8113, r=llogiq
bors Jan 5, 2022
a4ebf6f
Change `unnecessary_to_owned` `into_iter` suggestions to `MaybeIncorr…
smoelius Dec 30, 2021
14f3445
Don't lint `DequeVec` in `manual_memcpy`
Jarcho Jan 5, 2022
3925def
Suggest `copy_from_slice` for `manual_memcpy` when possible
Jarcho Jan 5, 2022
2cc38a2
Lint `iter_not_returning_iterator` on the trait definition rather tha…
Jarcho Jan 5, 2022
d98339d
Handle type projections in `iter_not_returning_iterator`
Jarcho Jan 5, 2022
94fe671
Allow running lintcheck with a renamed rust-clippy dir
Alexendoo Jan 6, 2022
be7cf76
Auto merge of #8234 - Alexendoo:lintcheck-allow-renamed-dir, r=xFrednet
bors Jan 7, 2022
c34e3f0
Update clippy for associated item changes
matthewjasper Nov 18, 2021
366234a
Add `unnecessary_to_owned` "Known problems" section
smoelius Jan 8, 2022
917890b
Auto merge of #8201 - smoelius:master, r=camsteffen
bors Jan 8, 2022
3ea5208
Set binary-dep-depinfo in .cargo/config.toml
sourcefrog Jan 8, 2022
83a9f68
Auto merge of #8249 - sourcefrog:depinfo, r=Manishearth
bors Jan 9, 2022
1288b80
rustc_metadata: Optimize and document module children decoding
petrochenkov Dec 18, 2021
c8ea042
rustc_metadata: Rename `item_children(_untracked)` to `module_childre…
petrochenkov Dec 23, 2021
f690978
cover trait for `trait_duplication_in_bounds`
dswij Jan 6, 2022
a6f80fc
new lint: `single_char_lifetime_names`
bors Jan 9, 2022
5991695
Auto merge of #8236 - PatchMixolydic:single_char_lifetime_names, r=ll…
bors Jan 9, 2022
16d8488
Combine internal features in clippy_utils
camsteffen Jan 10, 2022
e2ce4f9
Combine internal features in clippy_lints
camsteffen Jan 10, 2022
f4dc348
`trait_duplication_in_bounds` Update description and add test
dswij Jan 10, 2022
88cfd70
Auto merge of #8252 - dswij:8229, r=xFrednet
bors Jan 10, 2022
1816361
Auto merge of #8257 - camsteffen:internal-features, r=giraffate
bors Jan 10, 2022
b66dbe8
Auto merge of #8228 - Jarcho:iter_not_returning_iterator_8225, r=gira…
bors Jan 10, 2022
cf86cee
Downgrade mutex_atomic to nursery
taiki-e Jan 10, 2022
5f143c6
Warn disallowed_methods and disallowed_types by default
taiki-e Jan 10, 2022
e66ecf6
Run dogfood on windows
camsteffen Jan 10, 2022
7cf4f44
Fix output capturing
camsteffen Jan 10, 2022
51dbbf3
Refactor test utils
camsteffen Jan 10, 2022
d356fb9
Use `rustup which rustfmt`
camsteffen Jan 10, 2022
920e9f0
Move workspace test
camsteffen Jan 10, 2022
4a54933
Merge dogfood tests
camsteffen Jan 10, 2022
21343ab
Remove rustfmt component check
camsteffen Jan 10, 2022
51282fc
Auto merge of #8261 - taiki-e:disallowed, r=giraffate
bors Jan 10, 2022
01ef7c7
Fix dogfood
camsteffen Jan 10, 2022
fccf07b
Auto merge of #8260 - taiki-e:mutex_atomic, r=llogiq
bors Jan 11, 2022
3298de7
Add borrow_as_ptr lint
guerinoni Jan 2, 2022
fd97d79
`README`: `clippy-driver` is not a replacement for `rustc`
ojeda Nov 27, 2021
3d4fded
`README`: mention `clippy-driver` on usage list
ojeda Dec 14, 2021
dda2aef
Store a `Symbol` instead of an `Ident` in `VariantDef`/`FieldDef`
Aaron1011 Jan 3, 2022
fd9cebe
Auto merge of #8210 - guerinoni:master, r=Manishearth
bors Jan 11, 2022
02ec39b
Stop using in_band_lifetimes
camsteffen Jan 11, 2022
7e989ec
Improve documentation for `borrowed-box` lint
1nF0rmed Jan 10, 2022
88f5be2
Auto merge of #8262 - 1nF0rmed:chore-update-borrowed-box-doc, r=camst…
bors Jan 11, 2022
d32277d
Don't lint `deref_addrof` when the two operations occur in different …
Jarcho Jan 12, 2022
37e9985
Auto merge of #8268 - Jarcho:deref_addrof_8247, r=flip1995
bors Jan 12, 2022
0d94167
Auto merge of #8198 - camsteffen:no-method-call-macro, r=flip1995
bors Jan 12, 2022
ae01c4a
Auto merge of #8190 - camsteffen:no-in-band-liftetimes, r=flip1995
bors Jan 12, 2022
b9cae79
Auto merge of #8037 - ojeda:doc-codegen-change, r=camsteffen
bors Jan 12, 2022
166737f
Add manual_bits lint
paolobarbolini Jan 2, 2022
91581f6
Resolve primitive impls in clippy_utils::path_to_res
Alexendoo Dec 9, 2021
7c82ae1
Auto merge of #8213 - paolobarbolini:size-of-as-bits, r=flip1995
bors Jan 12, 2022
04eb27a
Use method name from conf::DisallowedMethod
Alexendoo Dec 9, 2021
6f33f69
Auto merge of #8112 - Alexendoo:disallowed_methods_primitives, r=flip…
bors Jan 12, 2022
90bf72c
Only run dogfood on linux in CI
camsteffen Jan 12, 2022
133b366
Auto merge of #8265 - camsteffen:which-rustfmt, r=xFrednet
bors Jan 12, 2022
5479024
Auto merge of #8266 - camsteffen:test-tweaks, r=flip1995
bors Jan 12, 2022
062db10
Add `manual_memcpy_test` for `VecDeque`
Jarcho Jan 12, 2022
60e68d6
Auto merge of #8226 - Jarcho:manual_memcpy_8160, r=flip1995
bors Jan 12, 2022
11be495
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Jan 13, 2022
8a2141b
Bump Clippy Version -> 0.1.60
flip1995 Jan 13, 2022
6ad05bc
Bump nightly version -> 2022-01-13
flip1995 Jan 13, 2022
97a5daa
Auto merge of #8272 - flip1995:rustup, r=flip1995
bors Jan 13, 2022
ba66384
Merge commit '97a5daa65908e59744e2bc625b14849352231c75' into clippyup
flip1995 Jan 13, 2022
159d6c3
Update Cargo.lock
flip1995 Jan 13, 2022
b83c77c
Fix Clippy sync fallout
flip1995 Jan 13, 2022
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clippy_lints/src/bool_assert_comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn is_bool_lit(e: &Expr<'_>) -> bool {
) && !e.span.from_expansion()
}

fn is_impl_not_trait_with_bool_out(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) -> bool {
fn is_impl_not_trait_with_bool_out(cx: &LateContext<'_>, e: &Expr<'_>) -> bool {
let ty = cx.typeck_results().expr_ty(e);

cx.tcx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fn check_case_sensitive_file_extension_comparison(ctx: &LateContext<'_>, expr: &
None
}

impl LateLintPass<'tcx> for CaseSensitiveFileExtensionComparisons {
impl<'tcx> LateLintPass<'tcx> for CaseSensitiveFileExtensionComparisons {
fn check_expr(&mut self, ctx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
if let Some(span) = check_case_sensitive_file_extension_comparison(ctx, expr) {
span_lint_and_help(
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/casts/cast_ptr_alignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rustc_span::symbol::sym;

use super::CAST_PTR_ALIGNMENT;

pub(super) fn check(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>) {
if let ExprKind::Cast(cast_expr, cast_to) = expr.kind {
if is_hir_ty_cfg_dependant(cx, cast_to) {
return;
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/casts/cast_ref_to_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rustc_middle::ty;

use super::CAST_REF_TO_MUT;

pub(super) fn check(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>) {
if_chain! {
if let ExprKind::Unary(UnOp::Deref, e) = &expr.kind;
if let ExprKind::Cast(e, t) = &e.kind;
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/casts/char_lit_as_u8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rustc_middle::ty::{self, UintTy};

use super::CHAR_LIT_AS_U8;

pub(super) fn check(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>) {
if_chain! {
if let ExprKind::Cast(e, _) = &expr.kind;
if let ExprKind::Lit(l) = &e.kind;
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/casts/ptr_as_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use rustc_semver::RustcVersion;

use super::PTR_AS_PTR;

pub(super) fn check(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, msrv: &Option<RustcVersion>) {
pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, msrv: &Option<RustcVersion>) {
if !meets_msrv(msrv.as_ref(), &msrvs::POINTER_CAST) {
return;
}
Expand Down
14 changes: 5 additions & 9 deletions clippy_lints/src/copies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ struct BlockEqual {

/// This function can also trigger the `IF_SAME_THEN_ELSE` in which case it'll return `None` to
/// abort any further processing and avoid duplicate lint triggers.
fn scan_block_for_eq(cx: &LateContext<'tcx>, blocks: &[&Block<'tcx>]) -> Option<BlockEqual> {
fn scan_block_for_eq(cx: &LateContext<'_>, blocks: &[&Block<'_>]) -> Option<BlockEqual> {
let mut start_eq = usize::MAX;
let mut end_eq = usize::MAX;
let mut expr_eq = true;
Expand Down Expand Up @@ -385,11 +385,7 @@ fn scan_block_for_eq(cx: &LateContext<'tcx>, blocks: &[&Block<'tcx>]) -> Option<
})
}

fn check_for_warn_of_moved_symbol(
cx: &LateContext<'tcx>,
symbols: &FxHashSet<Symbol>,
if_expr: &'tcx Expr<'_>,
) -> bool {
fn check_for_warn_of_moved_symbol(cx: &LateContext<'_>, symbols: &FxHashSet<Symbol>, if_expr: &Expr<'_>) -> bool {
get_enclosing_block(cx, if_expr.hir_id).map_or(false, |block| {
let ignore_span = block.span.shrink_to_lo().to(if_expr.span);

Expand Down Expand Up @@ -419,13 +415,13 @@ fn check_for_warn_of_moved_symbol(
}

fn emit_branches_sharing_code_lint(
cx: &LateContext<'tcx>,
cx: &LateContext<'_>,
start_stmts: usize,
end_stmts: usize,
lint_end: bool,
warn_about_moved_symbol: bool,
blocks: &[&Block<'tcx>],
if_expr: &'tcx Expr<'_>,
blocks: &[&Block<'_>],
if_expr: &Expr<'_>,
) {
if start_stmts == 0 && !lint_end {
return;
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub struct Default {

impl_lint_pass!(Default => [DEFAULT_TRAIT_ACCESS, FIELD_REASSIGN_WITH_DEFAULT]);

impl LateLintPass<'_> for Default {
impl<'tcx> LateLintPass<'tcx> for Default {
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
if_chain! {
if !expr.span.from_expansion();
Expand Down Expand Up @@ -110,7 +110,7 @@ impl LateLintPass<'_> for Default {
}

#[allow(clippy::too_many_lines)]
fn check_block<'tcx>(&mut self, cx: &LateContext<'tcx>, block: &Block<'tcx>) {
fn check_block(&mut self, cx: &LateContext<'tcx>, block: &Block<'tcx>) {
// start from the `let mut _ = _::default();` and look at all the following
// statements, see if they re-assign the fields of the binding
let stmts_head = match block.stmts {
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/default_numeric_fallback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ declare_clippy_lint! {

declare_lint_pass!(DefaultNumericFallback => [DEFAULT_NUMERIC_FALLBACK]);

impl LateLintPass<'_> for DefaultNumericFallback {
impl<'tcx> LateLintPass<'tcx> for DefaultNumericFallback {
fn check_body(&mut self, cx: &LateContext<'tcx>, body: &'tcx Body<'_>) {
let mut visitor = NumericFallbackVisitor::new(cx);
visitor.visit_body(body);
Expand Down
10 changes: 5 additions & 5 deletions clippy_lints/src/dereference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ impl<'tcx> LateLintPass<'tcx> for Dereferencing {
}
}

fn try_parse_ref_op(
fn try_parse_ref_op<'tcx>(
tcx: TyCtxt<'tcx>,
typeck: &'tcx TypeckResults<'_>,
expr: &'tcx Expr<'_>,
Expand Down Expand Up @@ -387,7 +387,7 @@ fn try_parse_ref_op(

// Checks whether the type for a deref call actually changed the type, not just the mutability of
// the reference.
fn deref_method_same_type(result_ty: Ty<'tcx>, arg_ty: Ty<'tcx>) -> bool {
fn deref_method_same_type(result_ty: Ty<'_>, arg_ty: Ty<'_>) -> bool {
match (result_ty.kind(), arg_ty.kind()) {
(ty::Ref(_, result_ty, _), ty::Ref(_, arg_ty, _)) => TyS::same_type(result_ty, arg_ty),

Expand Down Expand Up @@ -457,7 +457,7 @@ fn is_linted_explicit_deref_position(parent: Option<Node<'_>>, child_id: HirId,
}

/// Adjustments are sometimes made in the parent block rather than the expression itself.
fn find_adjustments(
fn find_adjustments<'tcx>(
tcx: TyCtxt<'tcx>,
typeck: &'tcx TypeckResults<'_>,
expr: &'tcx Expr<'_>,
Expand Down Expand Up @@ -499,7 +499,7 @@ fn find_adjustments(
}

#[allow(clippy::needless_pass_by_value)]
fn report(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, state: State, data: StateData) {
fn report(cx: &LateContext<'_>, expr: &Expr<'_>, state: State, data: StateData) {
match state {
State::DerefMethod {
ty_changed_count,
Expand Down Expand Up @@ -568,7 +568,7 @@ fn report(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, state: State, data: Stat
}

impl Dereferencing {
fn check_local_usage(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>, local: HirId) {
fn check_local_usage(&mut self, cx: &LateContext<'_>, e: &Expr<'_>, local: HirId) {
if let Some(outer_pat) = self.ref_locals.get_mut(&local) {
if let Some(pat) = outer_pat {
// Check for auto-deref
Expand Down
10 changes: 5 additions & 5 deletions clippy_lints/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ struct ContainsExpr<'tcx> {
key: &'tcx Expr<'tcx>,
call_ctxt: SyntaxContext,
}
fn try_parse_contains(cx: &LateContext<'_>, expr: &'tcx Expr<'_>) -> Option<(MapType, ContainsExpr<'tcx>)> {
fn try_parse_contains<'tcx>(cx: &LateContext<'_>, expr: &'tcx Expr<'_>) -> Option<(MapType, ContainsExpr<'tcx>)> {
let mut negated = false;
let expr = peel_hir_expr_while(expr, |e| match e.kind {
ExprKind::Unary(UnOp::Not, e) => {
Expand Down Expand Up @@ -280,7 +280,7 @@ struct InsertExpr<'tcx> {
key: &'tcx Expr<'tcx>,
value: &'tcx Expr<'tcx>,
}
fn try_parse_insert(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Option<InsertExpr<'tcx>> {
fn try_parse_insert<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Option<InsertExpr<'tcx>> {
if let ExprKind::MethodCall(_, _, [map, key, value], _) = expr.kind {
let id = cx.typeck_results().type_dependent_def_id(expr.hir_id)?;
if match_def_path(cx, id, &paths::BTREEMAP_INSERT) || match_def_path(cx, id, &paths::HASHMAP_INSERT) {
Expand All @@ -301,7 +301,7 @@ enum Edit<'tcx> {
/// An insertion into the map.
Insertion(Insertion<'tcx>),
}
impl Edit<'tcx> {
impl<'tcx> Edit<'tcx> {
fn as_insertion(self) -> Option<Insertion<'tcx>> {
if let Self::Insertion(i) = self { Some(i) } else { None }
}
Expand Down Expand Up @@ -532,7 +532,7 @@ struct InsertSearchResults<'tcx> {
allow_insert_closure: bool,
is_single_insert: bool,
}
impl InsertSearchResults<'tcx> {
impl<'tcx> InsertSearchResults<'tcx> {
fn as_single_insertion(&self) -> Option<Insertion<'tcx>> {
self.is_single_insert.then(|| self.edits[0].as_insertion().unwrap())
}
Expand Down Expand Up @@ -633,7 +633,7 @@ impl InsertSearchResults<'tcx> {
}
}

fn find_insert_calls(
fn find_insert_calls<'tcx>(
cx: &LateContext<'tcx>,
contains_expr: &ContainsExpr<'tcx>,
expr: &'tcx Expr<'_>,
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/equatable_if_let.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn unary_pattern(pat: &Pat<'_>) -> bool {
}
}

fn is_structural_partial_eq(cx: &LateContext<'tcx>, ty: Ty<'tcx>, other: Ty<'tcx>) -> bool {
fn is_structural_partial_eq<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>, other: Ty<'tcx>) -> bool {
if let Some(def_id) = cx.tcx.lang_items().eq_trait() {
implements_trait(cx, ty, def_id, &[other.into()])
} else {
Expand Down
10 changes: 8 additions & 2 deletions clippy_lints/src/erasing_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,19 @@ impl<'tcx> LateLintPass<'tcx> for ErasingOp {
}
}

fn different_types(tck: &TypeckResults<'tcx>, input: &'tcx Expr<'_>, output: &'tcx Expr<'_>) -> bool {
fn different_types(tck: &TypeckResults<'_>, input: &Expr<'_>, output: &Expr<'_>) -> bool {
let input_ty = tck.expr_ty(input).peel_refs();
let output_ty = tck.expr_ty(output).peel_refs();
!same_type_and_consts(input_ty, output_ty)
}

fn check(cx: &LateContext<'cx>, tck: &TypeckResults<'cx>, op: &Expr<'cx>, other: &Expr<'cx>, parent: &Expr<'cx>) {
fn check<'tcx>(
cx: &LateContext<'tcx>,
tck: &TypeckResults<'tcx>,
op: &Expr<'tcx>,
other: &Expr<'tcx>,
parent: &Expr<'tcx>,
) {
if constant_simple(cx, tck, op) == Some(Constant::Int(0)) {
if different_types(tck, other, parent) {
return;
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/from_over_into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl FromOverInto {

impl_lint_pass!(FromOverInto => [FROM_OVER_INTO]);

impl LateLintPass<'_> for FromOverInto {
impl<'tcx> LateLintPass<'tcx> for FromOverInto {
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) {
if !meets_msrv(self.msrv.as_ref(), &msrvs::RE_REBALANCING_COHERENCE) {
return;
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/from_str_radix_10.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ declare_clippy_lint! {

declare_lint_pass!(FromStrRadix10 => [FROM_STR_RADIX_10]);

impl LateLintPass<'tcx> for FromStrRadix10 {
impl<'tcx> LateLintPass<'tcx> for FromStrRadix10 {
fn check_expr(&mut self, cx: &LateContext<'tcx>, exp: &Expr<'tcx>) {
if_chain! {
if let ExprKind::Call(maybe_path, arguments) = &exp.kind;
Expand Down
6 changes: 3 additions & 3 deletions clippy_lints/src/functions/must_use.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use clippy_utils::{match_def_path, must_use_attr, return_ty, trait_ref_of_method

use super::{DOUBLE_MUST_USE, MUST_USE_CANDIDATE, MUST_USE_UNIT};

pub(super) fn check_item(cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) {
pub(super) fn check_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) {
let attrs = cx.tcx.hir().attrs(item.hir_id());
let attr = must_use_attr(attrs);
if let hir::ItemKind::Fn(ref sig, ref _generics, ref body_id) = item.kind {
Expand All @@ -40,7 +40,7 @@ pub(super) fn check_item(cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) {
}
}

pub(super) fn check_impl_item(cx: &LateContext<'tcx>, item: &'tcx hir::ImplItem<'_>) {
pub(super) fn check_impl_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::ImplItem<'_>) {
if let hir::ImplItemKind::Fn(ref sig, ref body_id) = item.kind {
let is_public = cx.access_levels.is_exported(item.def_id);
let fn_header_span = item.span.with_hi(sig.decl.output.span().hi());
Expand All @@ -62,7 +62,7 @@ pub(super) fn check_impl_item(cx: &LateContext<'tcx>, item: &'tcx hir::ImplItem<
}
}

pub(super) fn check_trait_item(cx: &LateContext<'tcx>, item: &'tcx hir::TraitItem<'_>) {
pub(super) fn check_trait_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::TraitItem<'_>) {
if let hir::TraitItemKind::Fn(ref sig, ref eid) = item.kind {
let is_public = cx.access_levels.is_exported(item.def_id);
let fn_header_span = item.span.with_hi(sig.decl.output.span().hi());
Expand Down
6 changes: 3 additions & 3 deletions clippy_lints/src/functions/not_unsafe_ptr_arg_deref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use clippy_utils::{iter_input_pats, path_to_local};

use super::NOT_UNSAFE_PTR_ARG_DEREF;

pub(super) fn check_fn(
pub(super) fn check_fn<'tcx>(
cx: &LateContext<'tcx>,
kind: intravisit::FnKind<'tcx>,
decl: &'tcx hir::FnDecl<'tcx>,
Expand All @@ -25,14 +25,14 @@ pub(super) fn check_fn(
check_raw_ptr(cx, unsafety, decl, body, cx.tcx.hir().local_def_id(hir_id));
}

pub(super) fn check_trait_item(cx: &LateContext<'tcx>, item: &'tcx hir::TraitItem<'_>) {
pub(super) fn check_trait_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::TraitItem<'_>) {
if let hir::TraitItemKind::Fn(ref sig, hir::TraitFn::Provided(eid)) = item.kind {
let body = cx.tcx.hir().body(eid);
check_raw_ptr(cx, sig.header.unsafety, sig.decl, body, item.def_id);
}
}

fn check_raw_ptr(
fn check_raw_ptr<'tcx>(
cx: &LateContext<'tcx>,
unsafety: hir::Unsafety,
decl: &'tcx hir::FnDecl<'tcx>,
Expand Down
6 changes: 3 additions & 3 deletions clippy_lints/src/functions/result_unit_err.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use clippy_utils::ty::is_type_diagnostic_item;

use super::RESULT_UNIT_ERR;

pub(super) fn check_item(cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) {
pub(super) fn check_item(cx: &LateContext<'_>, item: &hir::Item<'_>) {
if let hir::ItemKind::Fn(ref sig, ref _generics, _) = item.kind {
let is_public = cx.access_levels.is_exported(item.def_id);
let fn_header_span = item.span.with_hi(sig.decl.output.span().hi());
Expand All @@ -23,7 +23,7 @@ pub(super) fn check_item(cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) {
}
}

pub(super) fn check_impl_item(cx: &LateContext<'tcx>, item: &'tcx hir::ImplItem<'_>) {
pub(super) fn check_impl_item(cx: &LateContext<'_>, item: &hir::ImplItem<'_>) {
if let hir::ImplItemKind::Fn(ref sig, _) = item.kind {
let is_public = cx.access_levels.is_exported(item.def_id);
let fn_header_span = item.span.with_hi(sig.decl.output.span().hi());
Expand All @@ -33,7 +33,7 @@ pub(super) fn check_impl_item(cx: &LateContext<'tcx>, item: &'tcx hir::ImplItem<
}
}

pub(super) fn check_trait_item(cx: &LateContext<'tcx>, item: &'tcx hir::TraitItem<'_>) {
pub(super) fn check_trait_item(cx: &LateContext<'_>, item: &hir::TraitItem<'_>) {
if let hir::TraitItemKind::Fn(ref sig, _) = item.kind {
let is_public = cx.access_levels.is_exported(item.def_id);
let fn_header_span = item.span.with_hi(sig.decl.output.span().hi());
Expand Down
12 changes: 4 additions & 8 deletions clippy_lints/src/functions/too_many_arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ use clippy_utils::is_trait_impl_item;
use super::TOO_MANY_ARGUMENTS;

pub(super) fn check_fn(
cx: &LateContext<'tcx>,
kind: intravisit::FnKind<'tcx>,
decl: &'tcx hir::FnDecl<'_>,
cx: &LateContext<'_>,
kind: intravisit::FnKind<'_>,
decl: &hir::FnDecl<'_>,
span: Span,
hir_id: hir::HirId,
too_many_arguments_threshold: u64,
Expand Down Expand Up @@ -39,11 +39,7 @@ pub(super) fn check_fn(
}
}

pub(super) fn check_trait_item(
cx: &LateContext<'tcx>,
item: &'tcx hir::TraitItem<'_>,
too_many_arguments_threshold: u64,
) {
pub(super) fn check_trait_item(cx: &LateContext<'_>, item: &hir::TraitItem<'_>, too_many_arguments_threshold: u64) {
if let hir::TraitItemKind::Fn(ref sig, _) = item.kind {
// don't lint extern functions decls, it's not their fault
if sig.header.abi == Abi::Rust {
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/functions/too_many_lines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ use super::TOO_MANY_LINES;

pub(super) fn check_fn(
cx: &LateContext<'_>,
kind: FnKind<'tcx>,
kind: FnKind<'_>,
span: Span,
body: &'tcx hir::Body<'_>,
body: &hir::Body<'_>,
too_many_lines_threshold: u64,
) {
// Closures must be contained in a parent body, which will be checked for `too_many_lines`.
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/if_then_some_else_none.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl IfThenSomeElseNone {

impl_lint_pass!(IfThenSomeElseNone => [IF_THEN_SOME_ELSE_NONE]);

impl LateLintPass<'_> for IfThenSomeElseNone {
impl<'tcx> LateLintPass<'tcx> for IfThenSomeElseNone {
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'tcx Expr<'_>) {
if !meets_msrv(self.msrv.as_ref(), &msrvs::BOOL_THEN) {
return;
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/implicit_return.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ fn get_call_site(span: Span, ctxt: SyntaxContext) -> Option<Span> {
}

fn lint_implicit_returns(
cx: &LateContext<'tcx>,
expr: &'tcx Expr<'_>,
cx: &LateContext<'_>,
expr: &Expr<'_>,
// The context of the function body.
ctxt: SyntaxContext,
// Whether the expression is from a macro expansion.
Expand Down
Loading