Skip to content

Clippy subtree update #132746

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 162 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
62026c3
Add units/unit prefixes of frequency to doc-valid-idents
ROMemories Sep 26, 2024
b95aa31
Stabilize `isqrt` feature
ChaiTRex Oct 8, 2024
6b1779b
Add lint to check for slow symbol comparisons
GnomedDev Oct 12, 2024
dedc380
Apply fixes from lint
GnomedDev Oct 13, 2024
a650692
Add test
GnomedDev Oct 13, 2024
979e297
Update book
GnomedDev Oct 13, 2024
11162d1
fix: remove unnecessary unfilter_map usages
wowinter13 Oct 14, 2024
40cb24f
fix: simplify suggestion
wowinter13 Oct 15, 2024
ad002ea
fix: linter
wowinter13 Oct 15, 2024
8555922
Don't trigger const_is_empty for inline const assertions
alex-semenyuk Oct 17, 2024
fea5e77
Merge commit 'a109190d7060236e655fc75533373fa274ec5343' into clippy-s…
flip1995 Oct 18, 2024
91a458f
Hotfix TRAIT_METHODS static->const
flip1995 Oct 18, 2024
2c3a34a
pulldown-cmark: don't pull getopts dep
klensy Oct 18, 2024
82969e5
Allow to go through clippy lints page without javascript
GuillaumeGomez Oct 11, 2024
da19d47
Fix lints syntax highlighting
GuillaumeGomez Oct 14, 2024
47effe4
Auto merge of #13562 - klensy:pc, r=flip1995
bors Oct 18, 2024
6a79588
Auto merge of #13539 - GuillaumeGomez:allow-no-js, r=Alexendoo
bors Oct 18, 2024
a739cc3
Stop linting manual_bits in any macro invoke
GnomedDev Oct 18, 2024
f2f0175
Auto merge of #13543 - GnomedDev:symbol-comparisons, r=y21
bors Oct 18, 2024
5678531
Auto merge of #13564 - GnomedDev:fix-manualbits-in-macro, r=blyxyas
bors Oct 19, 2024
6983631
Do not run lints that cannot emit
blyxyas Nov 13, 2023
8f8aa46
Follow review comments (optimize the filtering)
blyxyas Jun 18, 2024
e427a4e
Remove module passes filtering
blyxyas Sep 7, 2024
e518d66
Apply review comments + use `shallow_lint_levels_on`
blyxyas Oct 15, 2024
38cf3f3
add debug assertions for overlapping spans and empty replacements
y21 Oct 19, 2024
4de65a1
fix empty suggestion ICE in from_over_into
y21 Oct 19, 2024
69b0886
Fix tests
compiler-errors Sep 27, 2024
64c4cf1
Fix version for `ref_option`
alex-semenyuk Oct 20, 2024
2a5de35
docs: remove stray comma
Kijewski Oct 20, 2024
aab0eee
make unsupported_calling_conventions a hard error
RalfJung Sep 3, 2024
d8b2f93
Rip out old effects var handling code from traits
compiler-errors Oct 20, 2024
65eb1ec
remove the semicolon for builtin macro call statements in `statement_…
y21 Oct 20, 2024
2666ed6
Fix indentation of website code snippets
Alexendoo Oct 20, 2024
2f71ce6
don't lint unnamed constants in `missing_docs_in_private_items`
y21 Oct 20, 2024
b3bf128
don't lint nested items that don't have generated documentation in `m…
y21 Oct 20, 2024
d00ab2e
Auto merge of #13569 - alex-semenyuk:fix_version, r=blyxyas
bors Oct 20, 2024
1d0dad5
Auto merge of #131988 - matthiaskrgr:rollup-tx173wn, r=matthiaskrgr
bors Oct 21, 2024
8538562
Auto merge of #13567 - y21:span_debug_assertions, r=flip1995
bors Oct 21, 2024
5873cb9
Auto merge of #13570 - Kijewski:pr-stray-comma, r=xFrednet
bors Oct 21, 2024
3773534
Move COGNITIVE_COMPLEXITY to use macro again
blyxyas Oct 19, 2024
f03f7c6
Auto merge of #129935 - RalfJung:unsupported_calling_conventions, r=c…
bors Oct 22, 2024
2fd8222
terminology: #[feature] *enables* a feature (instead of "declaring" o…
RalfJung Oct 8, 2024
78fc7bb
Auto merge of #131321 - RalfJung:feature-activation, r=nnethercote
bors Oct 22, 2024
088f07a
Represent TraitBoundModifiers as distinct parts in HIR
compiler-errors Oct 20, 2024
0bcc6f8
docs: Fix too_long_first_doc_paragraph: line -> paragraph
evanj Oct 22, 2024
97d13a8
Fix not working lint anchor
GuillaumeGomez Oct 22, 2024
b33977b
Fix invalid lint ID filtering
GuillaumeGomez Oct 22, 2024
54f9bc4
nightly feature tracking: get rid of the per-feature bool fields
RalfJung Oct 9, 2024
7115404
Open lint when clicking on its anchor
GuillaumeGomez Oct 23, 2024
cefa31a
Auto merge of #13588 - GuillaumeGomez:fix-lint-anchor, r=flip1995
bors Oct 23, 2024
b0412d0
borrow_deref_ref: do not trigger on `&raw` references
samueltardieu Oct 20, 2024
c2534dc
Auto merge of #13460 - ROMemories:feat/freq-units-allowed-idents, r=C…
bors Oct 24, 2024
eb6026a
Remove associated type based effects logic
compiler-errors Oct 20, 2024
6bcd0b9
Auto merge of #13558 - alex-semenyuk:const_is_empty_fix, r=dswij
bors Oct 24, 2024
5d681cf
Pass Ident by reference in ast Visitor
maxcabrajac Oct 24, 2024
9cf416d
Auto merge of #13586 - evanj:evan.jones/long-paragraph-edit, r=xFrednet
bors Oct 24, 2024
3338611
Switch CI from bors to merge queue
Kobzol Oct 25, 2024
59ecf4d
Fix is_from_proc_macro attr
RuairidhWilliamson Oct 25, 2024
a1ff955
Rollup merge of #132106 - maxcabrajac:ident_ref, r=petrochenkov
matthiaskrgr Oct 25, 2024
cd21594
tcx.is_const_fn doesn't work the way it is described, remove it
RalfJung Oct 12, 2024
8b9376a
Auto merge of #131349 - RalfJung:const-stability-checks, r=compiler-e…
bors Oct 25, 2024
560353c
Stop linting unused_io_amount in io traits
GnomedDev Oct 25, 2024
350d1c4
Effects cleanup
fee1-dead Oct 26, 2024
b75d511
Rollup merge of #132168 - fee1-dead-contrib:fxclean, r=compiler-errors
matthiaskrgr Oct 26, 2024
9e36f89
Auto merge of #125116 - blyxyas:ignore-allowed-lints-final, r=cjgillot
bors Oct 26, 2024
c4815ae
[`infinite_loops`]: fix suggestion error on async functions/closures
J-ZhengLi Oct 26, 2024
3caff99
Auto merge of #13571 - Alexendoo:website-code-indent, r=Centri3
bors Oct 26, 2024
a0fab5c
Auto merge of #13605 - GnomedDev:read-exact-in-read-exact, r=llogiq
bors Oct 27, 2024
900db48
Add test case for missing_errors_doc at tests with option check-priva…
alex-semenyuk Oct 27, 2024
c02f3a2
Auto merge of #13600 - samueltardieu:push-tzuvnutssmrs, r=xFrednet
bors Oct 27, 2024
31f6679
Auto merge of #13610 - alex-semenyuk:add_test_case, r=xFrednet
bors Oct 27, 2024
d0b15f1
Swap Msrv from Vec to SmallVec
GnomedDev Oct 27, 2024
f562d47
Unvacation giraffate and remove gh-pages -> xFrednet assignment
xFrednet Oct 27, 2024
12ca363
Auto merge of #13611 - xFrednet:0-giraffate-alumni, r=xFrednet
bors Oct 27, 2024
73bad36
Auto merge of #13548 - wowinter13:unnecessary_filter_map_filter_map_s…
bors Oct 27, 2024
62c4daf
New lint `needless_as_bytes`
samueltardieu Sep 21, 2024
f152bcb
Update the number of lints (over 700 → over 750)
samueltardieu Oct 28, 2024
d30a026
check if we need a parenthesis
CoCo-Japan-pan Oct 24, 2024
303ab51
Rollup merge of #131391 - ChaiTRex:isqrt, r=scottmcm,tgross35
matthiaskrgr Oct 28, 2024
f286174
New lint: `dangling_pointers_from_temporaries`
GrigorenkoPV Oct 16, 2024
a529c44
Auto merge of #13472 - GnomedDev:smaller-msrv, r=Jarcho
bors Oct 28, 2024
2e4a11e
Auto merge of #13338 - CoCo-Japan-pan:nonminimal_bool_casted, r=Centri3
bors Oct 28, 2024
d63322f
fix: usage of `a deprecated Node.js version`
hamirmahal Oct 28, 2024
d09d85d
Auto merge of #13614 - hamirmahal:fix/usage-of-a-deprecated-nodejs-ve…
bors Oct 28, 2024
c5df79d
Fire large_const_arrays for computed array lengths
GnomedDev Oct 28, 2024
528dcc3
Auto merge of #13620 - GnomedDev:large-const-array-compute-const, r=M…
bors Oct 28, 2024
149665a
Auto merge of #128985 - GrigorenkoPV:instantly-dangling-pointer, r=Urgau
bors Oct 29, 2024
353868a
Remove region from adjustments
compiler-errors Oct 29, 2024
625d391
Auto merge of #13437 - samueltardieu:issue-13434, r=y21
bors Oct 29, 2024
f2f73f9
Replace `.map(…).any(identity)` by `.any(…)`
samueltardieu Oct 4, 2024
91a1d16
Add new lint: `map_all_any_identity`
samueltardieu Oct 4, 2024
35a7095
Auto merge of #13499 - samueltardieu:map-all-any-identity, r=xFrednet
bors Oct 29, 2024
8d190cc
update tools
lcnr Oct 24, 2024
acc3842
Add new `map_with_unused_argument_over_ranges` lint
rspencer01 Jul 3, 2024
15ad824
Auto merge of #13034 - rspencer01:trivial_map_over_range, r=y21
bors Oct 29, 2024
ae82c75
Remove `Analysis::into_engine`.
nnethercote Oct 29, 2024
297f28c
Rollup merge of #132338 - nnethercote:rm-Engine, r=nnethercote
matthiaskrgr Oct 30, 2024
a304709
Do not use `gen` as a variable name
samueltardieu Oct 29, 2024
f7ab2c9
new lint: `source_item_ordering`
decryphe Aug 29, 2024
0c1ef98
Use match ergonomics compatible with editions 2021 and 2024
samueltardieu Oct 29, 2024
540e116
Return iterator must not capture lifetimes in Rust 2024
samueltardieu Oct 29, 2024
8052451
no_mangle attribute requires unsafe in Rust 2024
samueltardieu Oct 30, 2024
bd4aa17
Add 'CoAP' to doc-valid-idents
chrysn Oct 30, 2024
1bdc08a
Auto merge of #13599 - RuairidhWilliamson:proc_macro_attr, r=blyxyas
bors Oct 30, 2024
d9a0fec
Remap impl-trait lifetimes on HIR instead of AST lowering.
cjgillot Aug 20, 2024
323f144
Cleanup code suggestion for `into_iter_without_iter`
nyurik Oct 30, 2024
a7aa8bf
Watch `tests/compile-test.rs` in `cargo dev serve`
Alexendoo Oct 30, 2024
0c29fcc
Extend `large_include_file` lint to also work on attributes
GuillaumeGomez Oct 30, 2024
1998abc
Auto merge of #13633 - chrysn-pull-requests:doc-valid-ident-coap, r=C…
bors Oct 30, 2024
e1fa1b2
Auto merge of #13636 - GuillaumeGomez:extend-large_include_file, r=dswij
bors Oct 31, 2024
9f89421
Auto merge of #132301 - compiler-errors:adjust, r=lcnr
bors Oct 31, 2024
d30a0b2
`ConstCx` stop using `ParamEnv::reveal`
lcnr Oct 31, 2024
bad3edd
clippy: we've got a `LateContext` use it for `TypingMode`
lcnr Oct 31, 2024
2298a67
Auto merge of #13628 - samueltardieu:push-puluprmsyuzq, r=xFrednet
bors Oct 31, 2024
d7850ec
stop using `ParamEnv::reveal` while handling MIR
lcnr Oct 31, 2024
8568ca8
Auto merge of #13634 - nyurik:fix-iter-without-into, r=xFrednet,samue…
bors Oct 31, 2024
c2db7fa
Rollup merge of #132403 - lcnr:typing-mode, r=compiler-errors
workingjubilee Nov 1, 2024
012e306
Explain why clippy's HIR const eval exists
GnomedDev Oct 27, 2024
c782988
Auto merge of #13615 - GnomedDev:document-constevalctx-point, r=Alexe…
bors Nov 1, 2024
c056928
Improve display of clippy lints page when JS is disabled
GuillaumeGomez Oct 22, 2024
ca5c6f6
Improve theme handling when JS is disabled
GuillaumeGomez Oct 22, 2024
ac764df
Handle noscript style with "js" class on `<html>`.
GuillaumeGomez Nov 1, 2024
e4dc892
Auto merge of #13608 - J-ZhengLi:issue12338-new, r=Alexendoo
bors Nov 1, 2024
9d03956
Auto merge of #13635 - Alexendoo:cargo-dev-serve-watch-test, r=blyxyas
bors Nov 1, 2024
e8b78e2
Auto merge of #13630 - samueltardieu:push-qrnxuykslnsl, r=y21
bors Nov 1, 2024
5c6fe68
Auto merge of #13376 - decryphe:source-ordering, r=llogiq
bors Nov 2, 2024
52b8324
Auto merge of #13585 - GuillaumeGomez:no-js, r=Alexendoo
bors Nov 2, 2024
ddd1a86
Auto merge of #13573 - y21:issue13427, r=Centri3
bors Nov 3, 2024
2f1b7b6
needless_continue: check labels consistency before warning
samueltardieu Nov 3, 2024
040129b
Auto merge of #13629 - samueltardieu:push-nwukowumrvsn, r=flip1995
bors Nov 3, 2024
f0cf996
Rename the FIXMEs, remove a few that dont matter anymore
compiler-errors Nov 1, 2024
a1a9aae
Auto merge of #13631 - samueltardieu:push-uoowutzkvsrk, r=Centri3
bors Nov 3, 2024
ccf7c88
Auto merge of #13648 - samueltardieu:push-rpxvoukpolvm, r=Centri3
bors Nov 3, 2024
b14362f
ty::KContainer -> ty::AssocItemContainer::K
compiler-errors Nov 3, 2024
efeed55
Remove BorrowKind glob, make names longer
compiler-errors Nov 3, 2024
63d0ba9
Move two attribute lints to be early pass (post expansion)
jdonszelmann Nov 4, 2024
44c2a82
Swap Visitors to early exit, instead of storing poison flag
GnomedDev Nov 4, 2024
d8a3fcc
Auto merge of #132580 - compiler-errors:globs, r=Noratrieb
bors Nov 5, 2024
626406f
Do not filter empty passes & Make CTFE Clippy into lintless pass
blyxyas Nov 5, 2024
6631a2c
Auto merge of #13654 - GnomedDev:early-exit-visitors, r=Alexendoo
bors Nov 5, 2024
4847c40
Rollup merge of #132637 - blyxyas:lint-less-passes, r=flip1995
matthiaskrgr Nov 5, 2024
c931096
collect attribute spans early for disallowed macros
jdonszelmann Nov 5, 2024
c1ab18d
no_mangle_with_rust_abi: properly position the suggested ABI
samueltardieu Nov 5, 2024
f02a020
Auto merge of #13659 - samueltardieu:push-twtxmtvopoxo, r=blyxyas
bors Nov 6, 2024
7bcd578
Link fix
alex-semenyuk Nov 6, 2024
ab560d8
Auto merge of #13661 - alex-semenyuk:doc_fix, r=Manishearth
bors Nov 6, 2024
b816d4e
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Nov 7, 2024
03daf7c
Fix author lint and move it back to tests/ui
flip1995 Nov 7, 2024
4f12b98
Clean up declare_clippy_lint
flip1995 Nov 3, 2024
c64f1e3
Fix lint_without_lint_pass internal lint
flip1995 Nov 3, 2024
b27570b
Fix cargo dev update_lints
flip1995 Nov 3, 2024
a5d6100
Bump nightly version -> 2024-11-07
flip1995 Nov 7, 2024
d583df0
Remove ui/no_lints.rs test
flip1995 Nov 7, 2024
9ebe68d
Add conclusion job to PR CI
Kobzol Nov 7, 2024
843ef1b
Remove path filter
Kobzol Nov 7, 2024
a28c44f
Merge pull request #13587 from Kobzol/ci-remove-bors
flip1995 Nov 7, 2024
b116696
Remove CI badge from README and book
flip1995 Nov 7, 2024
3518178
Merge pull request #13639 from flip1995/rustup
flip1995 Nov 7, 2024
f712eb5
Merge pull request #13657 from jdonszelmann/disallowed-macros-to-early
flip1995 Nov 7, 2024
40aec58
Merge commit 'f712eb5cdccd121d0569af12f20e6a0fabe4364d' into clippy-s…
flip1995 Nov 7, 2024
2ab848b
Update Cargo.lock
flip1995 Nov 7, 2024
0aafd65
Clippy: cfg out validate_diag on release builds
flip1995 Nov 8, 2024
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
Prev Previous commit
Next Next commit
Add test
  • Loading branch information
GnomedDev committed Oct 13, 2024
commit a650692f8d53fb1ff3abf2ebb000721d1f4a4035
24 changes: 24 additions & 0 deletions tests/ui-internal/slow_symbol_comparisons.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#![feature(rustc_private)]
#![warn(clippy::slow_symbol_comparisons)]

extern crate rustc_span;

use clippy_utils::sym;
use rustc_span::Symbol;

fn main() {
let symbol = sym!(example);
let other_symbol = sym!(other_example);

// Should lint
let slow_comparison = symbol.as_str() == "example";
//~^ error: comparing `Symbol` via `Symbol::intern`
let slow_comparison_macro = symbol.as_str() == "example";
//~^ error: comparing `Symbol` via `Symbol::intern`
let slow_comparison_backwards = symbol.as_str() == "example";
//~^ error: comparing `Symbol` via `Symbol::intern`

// Should not lint
let faster_comparison = symbol.as_str() == "other_example";
let preinterned_comparison = symbol == other_symbol;
}
24 changes: 24 additions & 0 deletions tests/ui-internal/slow_symbol_comparisons.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#![feature(rustc_private)]
#![warn(clippy::slow_symbol_comparisons)]

extern crate rustc_span;

use clippy_utils::sym;
use rustc_span::Symbol;

fn main() {
let symbol = sym!(example);
let other_symbol = sym!(other_example);

// Should lint
let slow_comparison = symbol == Symbol::intern("example");
//~^ error: comparing `Symbol` via `Symbol::intern`
let slow_comparison_macro = symbol == sym!(example);
//~^ error: comparing `Symbol` via `Symbol::intern`
let slow_comparison_backwards = sym!(example) == symbol;
//~^ error: comparing `Symbol` via `Symbol::intern`

// Should not lint
let faster_comparison = symbol.as_str() == "other_example";
let preinterned_comparison = symbol == other_symbol;
}
23 changes: 23 additions & 0 deletions tests/ui-internal/slow_symbol_comparisons.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
error: comparing `Symbol` via `Symbol::intern`
--> tests/ui-internal/slow_symbol_comparisons.rs:14:27
|
LL | let slow_comparison = symbol == Symbol::intern("example");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Symbol::as_str` and check the string instead: `symbol.as_str() == "example"`
|
= note: `-D clippy::slow-symbol-comparisons` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::slow_symbol_comparisons)]`

error: comparing `Symbol` via `Symbol::intern`
--> tests/ui-internal/slow_symbol_comparisons.rs:16:33
|
LL | let slow_comparison_macro = symbol == sym!(example);
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use `Symbol::as_str` and check the string instead: `symbol.as_str() == "example"`

error: comparing `Symbol` via `Symbol::intern`
--> tests/ui-internal/slow_symbol_comparisons.rs:18:37
|
LL | let slow_comparison_backwards = sym!(example) == symbol;
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use `Symbol::as_str` and check the string instead: `symbol.as_str() == "example"`

error: aborting due to 3 previous errors