Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
c1de8ed
`incompatible_msrv`: Don't check the const version for functions refe…
Jarcho Sep 30, 2025
d860954
Remove boxes from ast Pat lists
camsteffen Sep 4, 2025
813eb08
`clippy_dev`: Move parsing code to it's own module.
Jarcho May 31, 2025
4f403f3
`clippy_dev`: Validate lint name format during argument parsing.
Jarcho Oct 10, 2025
88c0674
`clippy_dev`: Rename `RustSearcher` to `Cursor` and move it to its ow…
Jarcho Oct 10, 2025
5e36990
`clippy_dev`: Use the new ranges.
Jarcho Oct 10, 2025
422d459
`clippy_dev`: Capture token patterns by position and length.
Jarcho Oct 10, 2025
1b31b09
`clippy_dev`: Add specialized helpers for finding identifiers to the …
Jarcho Oct 11, 2025
3e1f862
clean-up tests
ada4a Oct 12, 2025
2fe9d4b
option_option: split part of diagnostic message into help message
ada4a Oct 12, 2025
5f0f7d8
return spans out of is_doc_comment to reduce reliance on .span() on a…
jdonszelmann Oct 14, 2025
1e1c1f3
Add multiple-inherent-impl tests
nickdrozd Oct 14, 2025
14b446c
Rollup merge of #147676 - jdonszelmann:span-is-doc-comment, r=Guillau…
matthiaskrgr Oct 15, 2025
2c8a9e2
Auto merge of #146221 - camsteffen:ast-boxes, r=cjgillot
bors Oct 16, 2025
d449806
`manual_unwrap_or(_default)`: don't lint if not safe to move scrutinee
zihan0822 Oct 4, 2025
8f61305
Merge commit 'd9fb15c4b1ebe9e7dc419e07f53af681d7860cbe' into clippy-s…
flip1995 Oct 16, 2025
6a0aa12
Fix clippy for impl_trait_header changes
camsteffen Oct 7, 2025
269679e
Update link to the Code of Conduct
alex-semenyuk Oct 17, 2025
1ecb18a
Update link to the Code of Conduct (#15903)
Alexendoo Oct 17, 2025
4463ba7
clean-up tests
ada4a Oct 12, 2025
b0ecbdf
fix `option_map_unit_fn_unfixable.rs`
ada4a Oct 12, 2025
98db098
improve the suggestion
ada4a Oct 12, 2025
c6426f5
Revert "fix(elidable_lifetime_names): avoid overlapping spans in sugg…
ada4a Oct 19, 2025
9ee9fd0
refactor(manual_div_ceil): move to under `operators/`
ada4a Oct 19, 2025
70de06f
clean-up a bit
ada4a Oct 19, 2025
c8c23bc
fix(empty_enum): don't lint if all variants happen to be `cfg`-d out
ada4a Oct 19, 2025
1ac3cc1
fix(empty_enum): don't lint if all variants happen to be `cfg`-d out …
samueltardieu Oct 20, 2025
95dd88d
refactor(manual_div_ceil_: move to under `operators/` (#15909)
samueltardieu Oct 20, 2025
5578908
chore(empty_enum): rename to `empty_enums`
ada4a Oct 19, 2025
4e3fa96
refactor(option_as_ref_cloned): move the `method_call` call out of th…
ada4a Oct 20, 2025
0702934
`manual_let_else` fix when expression finishes with '}'
teofr Oct 20, 2025
973e596
`option_option`: split part of diagnostic message into help message (…
Alexendoo Oct 20, 2025
b5c3ed0
refactor: Move to anstream + anstyle for styling
Muscraft Jun 4, 2025
960c01f
Add not-null pointer patterns to pattern types
oli-obk Jan 24, 2025
d9ecbb7
clean-up
ada4a Oct 20, 2025
c5215b6
clean-up a bit
ada4a Oct 21, 2025
a8fa9e1
clean-up
ada4a Oct 21, 2025
91dbaae
improve diagnostics
ada4a Oct 21, 2025
cb33ccd
improve diagnostics
ada4a Oct 21, 2025
97d6049
Mark range expr with desugaring
camsteffen Sep 10, 2025
a6e5159
fix: parenthesise the receiver if needed
ada4a Oct 21, 2025
37ebd4c
move the lint file to under `methods/`
ada4a Oct 21, 2025
81d2300
move to `methods/`, for real this time
ada4a Oct 21, 2025
039b40f
`match_as_ref`: improve diagnostics (#15928)
samueltardieu Oct 21, 2025
fb82de5
`manual_option_as_slice: improve diagnostics (#15926)
samueltardieu Oct 21, 2025
c6c71af
refactor(option_as_ref_cloned): move the `method_call` call out of th…
samueltardieu Oct 21, 2025
17f1942
Adapt the logic from `extra_unused_type_parameters`
ada4a Oct 19, 2025
bab7519
Update mod.rs
ZylosLumen Oct 22, 2025
fd20839
Make docs more clear (#15933)
samueltardieu Oct 22, 2025
5ff804e
misc: move infallible stuff out of the way
ada4a Oct 22, 2025
2bb3d0c
refactor(elidable_lifetimes): harmonize suggestion-building logic wit…
samueltardieu Oct 22, 2025
22bdd9f
fix(match_as_ref): suggest `as_ref` when the reference needs to be cast
ada4a Oct 21, 2025
0c592df
fix(match_as_ref): suggest `as_ref` when the reference needs to be ca…
samueltardieu Oct 22, 2025
2c1ceea
Auto merge of #147207 - Muscraft:anstyle-anstream, r=davidtwco
bors Oct 22, 2025
00f68d5
`clippy_dev`: parsing revamp 1/N (#15866)
samueltardieu Oct 22, 2025
de63d25
fix: Don't add diff symbol to unchanged lines
Muscraft Oct 22, 2025
fcfab5f
`clippy_dev`: Move all parsing within a parse context.
Jarcho Oct 10, 2025
7579e71
`clippy_dev`: Inline and simplify `read_src_with_module`.
Jarcho Oct 11, 2025
bae625f
`clippy_dev`: Allocate onto an arena when parsing.
Jarcho Oct 11, 2025
6026cc9
Replace NullOp::SizeOf and NullOp::AlignOf by lang items.
cjgillot Oct 16, 2025
26b12a9
Retire ast::TyAliasWhereClauses.
cjgillot Oct 15, 2025
cd5b0b6
Auto merge of #147793 - cjgillot:no-null-op, r=scottmcm,oli-obk
bors Oct 23, 2025
ab15129
Rollup merge of #147713 - cjgillot:where-cfg, r=fmease
jhpratt Oct 23, 2025
8d15b5f
Auto merge of #148014 - jhpratt:rollup-aglren3, r=jhpratt
bors Oct 23, 2025
82d729c
`clippy_dev`: Parsing revamp part 2/N (#15921)
samueltardieu Oct 23, 2025
09c3237
chore(empty_enum): rename to `empty_enums` (#15912)
dswij Oct 23, 2025
9fd359b
clean-up
ada4a Oct 21, 2025
9145cee
make the spans more precise
ada4a Oct 21, 2025
c238924
Revert "Auto merge of #146121 - Muscraft:filter-suggestion-parts, r=p…
lqd Oct 23, 2025
0cc1594
Fix trait method checking in book
samueltardieu Oct 23, 2025
9eba2cc
fix: `len_zero` FP on unstable methods
profetia Oct 16, 2025
8ff0cf8
Fix `len_zero` FP on unstable methods (#15894)
samueltardieu Oct 23, 2025
21d3b9d
split test files for `use_debug` and `print_stdout`
ada4a Oct 24, 2025
f975caa
Fix trait method checking in book (#15941)
Jarcho Oct 24, 2025
3dcf399
fix(`manual_let_else`): expressions ending with `'}'` (#15919)
Jarcho Oct 24, 2025
d1b51ea
`{option,result}_map_unit_fn`: fix and clean-up tests, make suggestio…
Jarcho Oct 24, 2025
622a77d
feat(search_is_some): Fix when the closure spans multiple lines
Oct 16, 2025
aae10d7
refactor(double_comparison): clean-up, simplify lint logic
ada4a Oct 26, 2025
ce2ef31
fix(needless_if): don't expand macro invocations in the suggestion
ada4a Oct 26, 2025
0ba9ba7
Prepare for mdbook 0.5
ehuss Oct 26, 2025
25cbcb4
refactor(lines_filter_map_ok): move to under `methods/` (#15925)
Jarcho Oct 26, 2025
05aaed9
Auto merge of #146069 - camsteffen:range-desugar-span, r=SparrowLii
bors Oct 27, 2025
12b011b
Lint precedence possible ambiguity between closure and method call
samueltardieu Mar 16, 2025
da89652
refactor(double_comparison): clean-up, simplify lint logic (#15955)
samueltardieu Oct 27, 2025
c5714b0
Prepare for mdbook 0.5 (#15965)
samueltardieu Oct 27, 2025
a0a347e
fix(needless_if): don't expand macro invocations in the suggestion (#…
samueltardieu Oct 27, 2025
640e118
chore(needless_if): rename to `needless_ifs`
ada4a Oct 26, 2025
d349b20
fix(use_debug): don't get confused by nested `Debug` impls
ada4a Oct 24, 2025
b0d93f1
chore(needless_if): rename to `needless_ifs` (#15961)
Alexendoo Oct 27, 2025
0029a91
Lint precedence possible ambiguity between closure and method call (#…
Alexendoo Oct 27, 2025
a5b3c44
Consider labels of inline asm as conditionally executed
samueltardieu Sep 14, 2025
ca168c0
`unnecessary_{find,filter}_map`: make diagnostic spans more precise (…
dswij Oct 27, 2025
0226fa9
Consider labels of inline asm as conditionally executed (#15676)
Alexendoo Oct 27, 2025
0ff3a38
Improve doc comment code language tag parsing, don't use a full parser
Alexendoo Oct 27, 2025
bc5bd29
Remove QPath::LangItem from for loops
camsteffen Sep 1, 2025
ae9d202
Remove QPath::LangItem from ranges
camsteffen Aug 17, 2025
930dfc8
Remove QPath::LangItem from async
camsteffen Aug 17, 2025
e2b3508
Remove QPath::LangItem from try
camsteffen Sep 1, 2025
a2d8955
Remove QPath::LangItem
camsteffen Sep 1, 2025
f144c6c
feat(search_is_some): Fix when the closure spans multiple lines (#15902)
Jarcho Oct 28, 2025
02e4516
fix(double_parens): don't lint in proc-macros
ada4a Oct 23, 2025
78db66e
Remove AssignDesugar span
camsteffen Oct 28, 2025
97e681f
Changelog for Clippy 1.91
alex-semenyuk Oct 25, 2025
e71b46f
refactor(invalid_upcast_comparisons): move to under `operators`
ada4a Oct 26, 2025
d74200a
refactor(invalid_upcast_comparisons): move to under `operators`, simp…
samueltardieu Oct 28, 2025
7012a5d
`incompatible_msrv`: Don't check the const MSRV for uncalled function…
samueltardieu Oct 29, 2025
90b34cb
put the operators in backticks in the diagnostics
ada4a Oct 25, 2025
967d2b1
chore(integer_division_remainder_used): move to under `operators`
ada4a Oct 25, 2025
35e55a6
`manual_unwrap_or(_default)`: don't lint if not safe to move scrutine…
flip1995 Oct 29, 2025
c95db07
test(while_immutable_condition): call the test file the same as the lint
ada4a Oct 29, 2025
7c86faa
test(while_immutable_condition): call the test file the same as the l…
llogiq Oct 29, 2025
5a90737
Add multiple-inherent-impl tests (#15886)
llogiq Oct 29, 2025
d05f74e
refactor(integer_division_remainder_used): move to under `operators` …
samueltardieu Oct 29, 2025
52fa003
Auto merge of #148193 - camsteffen:remove-qpath-langitem, r=cjgillot
bors Oct 30, 2025
5e7ce90
Improve doc comment code language tag parsing, don't use a full parse…
dswij Oct 30, 2025
b69d2ff
Changelog for Clippy 1.91 🎃 (#15971)
Jarcho Oct 31, 2025
bcc40ce
fix(double_parens): don't lint in proc-macros (#15939)
Jarcho Oct 31, 2025
e415911
fix(use_debug): don't get confused by nested `Debug` impls (#15946)
Jarcho Oct 31, 2025
88554d6
Remove/fix setTimeout logic in lints page
Alexendoo Oct 29, 2025
0b784f8
Remove/fix setTimeout logic in lints page (#15983)
Jarcho Oct 31, 2025
f64e401
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Oct 31, 2025
2b9c8f1
Bump nightly version -> 2025-10-31
flip1995 Oct 31, 2025
a531040
Bump Clippy version -> 0.1.93
flip1995 Oct 31, 2025
c936595
Rustup (#16000)
flip1995 Oct 31, 2025
534b81c
Merge commit 'c936595d17413c1f08e162e117e504fb4ed126e4' into clippy-s…
flip1995 Oct 31, 2025
be5093e
Update Cargo.lock
flip1995 Oct 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove QPath::LangItem from for loops
  • Loading branch information
camsteffen committed Oct 28, 2025
commit bc5bd29ce6fd5daec2aa75ec740f0ac48c0634e2
8 changes: 5 additions & 3 deletions clippy_lints/src/ranges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use clippy_config::Conf;
use clippy_utils::consts::{ConstEvalCtxt, Constant};
use clippy_utils::diagnostics::{span_lint, span_lint_and_sugg, span_lint_and_then};
use clippy_utils::msrvs::{self, Msrv};
use clippy_utils::res::{MaybeQPath, MaybeResPath};
use clippy_utils::res::MaybeResPath;
use clippy_utils::source::{SpanRangeExt, snippet, snippet_with_applicability};
use clippy_utils::sugg::Sugg;
use clippy_utils::ty::implements_trait;
Expand All @@ -15,7 +15,7 @@ use rustc_lint::{LateContext, LateLintPass, Lint};
use rustc_middle::ty::{self, ClauseKind, GenericArgKind, PredicatePolarity, Ty};
use rustc_session::impl_lint_pass;
use rustc_span::source_map::Spanned;
use rustc_span::{Span, sym};
use rustc_span::{DesugaringKind, Span, sym};
use std::cmp::Ordering;

declare_clippy_lint! {
Expand Down Expand Up @@ -368,7 +368,9 @@ fn can_switch_ranges<'tcx>(
// Check if `expr` is the argument of a compiler-generated `IntoIter::into_iter(expr)`
if let ExprKind::Call(func, [arg]) = parent_expr.kind
&& arg.hir_id == use_ctxt.child_id
&& func.opt_lang_path() == Some(LangItem::IntoIterIntoIter)
&& let ExprKind::Path(qpath) = func.kind
&& cx.tcx.qpath_is_lang_item(qpath, LangItem::IntoIterIntoIter)
&& parent_expr.span.is_desugaring(DesugaringKind::ForLoop)
{
return true;
}
Expand Down