Commit graph

445 commits

Author SHA1 Message Date
Philipp Krones
874f1c8dc0
Update actions/checkouts to v5 (#15457)
Update
[actions/checkouts](https://github.com/actions/checkout?tab=readme-ov-file#usage)
to v5

changelog: none
2025-08-11 17:59:04 +00:00
Alexey Semenyuk
696d96daa1 Update actions/checkouts to v5 2025-08-11 19:40:49 +05:00
Ada Alakbarova
2293095c91
doc: use is_some_and instead of map_or(false, _)
see
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or
2025-08-11 09:48:20 +02:00
Alex Macleod
7dd3ecb1f9
Update CONTRIBUTING.md to use RustRover instead of IntelliJ Rust (#15448)
JetBrains has transitioned from the IntelliJ Rust plugin to RustRover as
their dedicated Rust IDE. This updates the documentation to reflect this
change while maintaining backward compatibility with the existing `cargo
dev setup intellij` command.

Changes:
- Replace IntelliJ Rust references with RustRover in CONTRIBUTING.md
- Update links to point to official RustRover homepage
- Update development guide in book/src/development/basics.md
- Keep existing command names for backward compatibility

**Question**: Do we also need to change the `intellij` command to
`rustrover`?

fixes rust-lang/rust-clippy#15406

changelog: Update CONTRIBUTING.md to reference RustRover instead of
deprecated IntelliJ Rust
2025-08-10 13:52:35 +00:00
reddevilmidzy
aeec153974 Update CONTRIBUTING.md to use RustRover instead of IntelliJ Rust
JetBrains has transitioned from the IntelliJ Rust plugin to RustRover
as their dedicated Rust IDE. This updates the documentation to reflect
this change while maintaining backward compatibility with the existing
cargo dev setup intellij command.

Changes:
- Replace IntelliJ Rust references with RustRover in CONTRIBUTING.md
- Update links to point to official RustRover homepage
- Update development guide in book/src/development/basics.md
- Keep existing command names for backward compatibility
2025-08-10 01:45:54 +09:00
Dave Rolsky
5c617b4867
Add "PowerPC" to the list of valid CamelCase strings in docs 2025-08-09 10:28:14 -05:00
Samuel Tardieu
18a13b15fe
Do not treat NixOS as a Pascal-cased identifier 2025-07-28 15:25:46 +02:00
alexey semenyuk
f3b3c096fd Polishing changelog update doc 2025-06-30 17:19:12 +05:00
Samuel Tardieu
9117cb0223
zero_ptr: lint in const context as well
The lint was extra restrictive, and didn't suggest using
`core::ptr::null` and `core::ptr::null_mut` in `const` contexts although
they have been const-stabilized since Rust 1.24.
2025-06-26 23:09:37 +02:00
Philipp Krones
8050e591b6
Update book and templates with feature freeze (#14456)
This PR announces the feature freeze period talked about in
https://github.com/rust-lang/rust-clippy/issues/14364

1. Add the page to the book
2. Modify the in-Github templates.
3. The third commit (to be squashed into the first) rolls the date
mentioned 6 weeks (so, starting on May 9th and ending on August 20th).
This gives us a comfortable buffer to make choices for this period.

We have a pending discussion on the #14364. So having some more time to
make choices is very nice. I'm also preparing a Github action for
detecting new lints and posting a comment about the feature freeze
(being worked on in another branch)

Something I'd like comment on is the date formatting. I'm not sure if
"May 9th to the first of August" is the correct way of writing this
information in a book 😅.

changelog: Announce the feature freeze from May 9th to the first of
August
2025-06-26 16:45:13 +00:00
Philipp Krones
b88d162d2a
Add link to the feature freeze tracking issue to the book 2025-06-26 18:40:51 +02:00
Samuel Tardieu
19c1c70905
Add allow-invalid configuration option for disallowed_* to the documentation (#14845)
Close rust-lang/rust-clippy#14836

changelog: none
2025-06-17 09:05:05 +00:00
Samuel Tardieu
506411d9d1
Fix collapsible_else_if FP on conditionally compiled stmt (#14906)
Closes rust-lang/rust-clippy#14799

changelog: [`collapsible_else_if`] fix FP on conditionally compiled stmt
2025-06-13 15:45:00 +00:00
yanglsh
fea8dd28a0 Lint more cases in collapsible_else_if 2025-06-13 22:54:59 +08:00
Samuel Tardieu
af5b6e8c8e
docs(trait_checking): import the right function (#14891)
`is_trait_method` is not even used in this codeblock, whereas
`implements_trait` is used but not imported

(not sure if this is _actually_ a "changelog: none", since the
documentation is at least contributor-facing)

changelog: none
2025-05-30 08:28:04 +00:00
Kazuki Obata
402fc8105b
Update trait_checking.md 2025-05-28 23:37:31 +09:00
blyxyas
6f0fae3748 Minor fixes and date correction to book page 2025-05-28 14:05:19 +02:00
Ada Alakbarova
aa667f4317
use the correct path to the function 2025-05-25 13:39:03 +02:00
Ada Alakbarova
6291b91cad
docs(trait_checking): import the right function
`is_trait_method` is not even used in this codeblock, whereas `implements_trait` is used but not imported
2025-05-25 02:41:29 +02:00
Jason Newcomb
9fa448a119
Make trivial-copy-size-limit consistently the size of the target pointer (#13319)
Fixes
https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Ambiguous.20default.20value.20for.20.60trivial-copy-size-limit.60

The current situation is

| Target width | `trivial-copy-size-limit`|
|--------|--------|
| 8-bit | 2 |
| 16-bit | 4 |
| 32-bit | 8 |
| 64-bit | 8 |

~~Since practically speaking it's almost always 8, let's go with that as
the unconditional default to make it easier to understand~~

Now defaults to `target_pointer_width`

changelog: [`trivial-copy-size-limit`] now also defaults to the size of
a target pointer (unchanged for 64-bit targets)
2025-05-21 20:05:31 +00:00
Timo
03ba508d0e
Fixes manual_slice_size_computation ICE and triggers in const context (#14804)
The first commit fixes rust-lang/rust-clippy#14802: when a slice is
directly present, it must be dereferenced (instead of referenced -1
times) before being passed to `mem::size_of_val()`.

The second commit triggers the lint in a `const` contact when MSRV ≥
1.85.

changelog: [`manual_slice_size_computation`]: fix ICE in suggestion to
efficiently compute the size of a slice, and trigger the lint in `const`
context as well
2025-05-20 22:35:15 +00:00
Alexey Semenyuk
0bac1ca2a7 Add allow-invalid configuration option for disallowed_* to the documentation 2025-05-20 09:22:37 +05:00
Philipp Krones
7123f2acf7
Docs: Use spaces in good first issue label
This unifies the Clippy repo with the rest of the rust org repos.
2025-05-19 09:37:47 +02:00
Pete LeVasseur
1e3fc3cc46 fix minor typo: toolcahin => toolchain
changelog: none
2025-05-18 17:26:28 +09:00
Samuel Tardieu
fe4b4e8329
mem::size_of_val is const-stable since Rust 1.85 2025-05-14 23:38:37 +02:00
SLUCHABLUB
488e4e53d2 Add the allow_exact_repetitions option to the module_name_repetitions lint. 2025-05-14 10:49:01 +02:00
Philipp Krones
54aa120f18
Update "Changelog update walkthrough" section (#14785)
Update "Changelog update walkthrough" section based on
rust-lang/rust-clippy#14748 discussion

changelog: none
2025-05-12 19:29:36 +00:00
Alexey Semenyuk
2215282fa4 Update Changelog update walkthrough docs section 2025-05-12 22:15:53 +05:00
Kazuki Obata
18eb293435
update dev doc: update FnKind::Fn matching
Ident was moved to the struct Fn in https://github.com/rust-lang/rust/pull/138740
2025-05-11 16:05:31 +09:00
Samuel Tardieu
bde939058b
char::is_digit() is const-stable only since Rust 1.87
The `to_digit_is_some()` lint suggests using `char::is_digit()`. It
should not trigger in const contexts before Rust 1.87.
2025-05-10 00:20:55 +02:00
Alex Macleod
33f81c08aa Use cargo dev setup toolchain in install from source docs 2025-05-09 01:38:20 +00:00
Samuel Tardieu
73dd05cc7a
add allow_unused config to missing_docs_in_private_items (#14453)
fixes #14413
add allow_unused config to missing_docs_in_private_items for underscored
field

changelog: [`missing_docs_in_private_items`]: add allow_unused config to
missing_docs_in_private_items for underscored field

Explaination (quoted from the issue's author): When writing structures
that must adhere to a specific format (such as memory mapped I/O
structures) there are inevitably fields that are "reserved" by
specifications and thus need no documentation. In cases where private
docs are preferred but reserved fields need no explanation, having to
#[allow/expect] this lint removes the ability to check for otherwise
used fields' documentation.
2025-05-06 17:18:14 +00:00
Alex Macleod
b768fbe4bc Replace str path utils with new PathLookup type 2025-05-04 15:26:37 +00:00
Quang Duong Nguyen
481abc1361 fix doc 2025-05-03 15:17:03 -07:00
Quang Duong Nguyen
c468552097 add allow_unused config to missing_docs_in_private_items
add allow_unused config to missing_docs_in_private_items for underscored field
2025-05-03 15:17:03 -07:00
Alex Macleod
b52bd96713 Replace interning of string literals with preinterned symbols 2025-04-18 22:44:16 +00:00
Timo
781fdab9a9
Move internal lints to their own crate (#13223)
This makes it so switching the internal feature on/off no longer
rebuilds `clippy_lints`.

r? @flip1995

changelog: none
2025-04-18 12:04:08 +00:00
Alejandra González
02764f611a
Various fixes for manual_is_power_of_two (#14463)
Fix #14461:

- insert parentheses as required in suggestion
- check MSRV before suggesting fix in `const` context
- do not lint macro expansion result

Commits have been logically separated to facilitate review, and start
with a refactoring (and simplification) of the existing code.

changelog: [`manual_is_power_of_two`]: insert parentheses as required in
suggestion, check MSRV before suggesting fix in `const` context, do not
lint macro expansion results
2025-04-14 22:56:38 +00:00
Samuel Tardieu
4d343d56e1 Check MSRV before suggesting fix in const context 2025-04-14 22:05:44 +02:00
Jason Newcomb
5b4b463d49 Move internal lints to their own crate 2025-04-12 17:53:36 -04:00
Samuel Tardieu
dd21b6ecea book: indicate that at least one error marker is required
This is a recent change, and no error marker is inserted by default in
the file generated by `cargo dev new_lint`.
2025-04-11 13:11:25 +02:00
blyxyas
27d00a53fc Fix typos in review 2025-04-07 02:03:03 +02:00
blyxyas
dd8d9232c2 Fix remark CI issues 2025-04-07 02:02:31 +02:00
Alex Macleod
ae0e3b7e38 Default trivial_copy_size_limit to the width of a target pointer 2025-04-03 12:18:45 +00:00
Yotam Ofek
52a3082056 add manual_abs_diff lint 2025-04-02 19:40:14 +00:00
Timo
d88818d1e7
Rename inconsistent_struct_constructor configuration; don't suggest deprecated configurations (#14280)
This PR does two things:
- It renames `inconsistent_struct_constructor`'s configuration from
`lint-inconsistent-struct-field-initializers` to
`check-inconsistent-struct-field-initializers`. (I should have suggested
`check-...` in
[#13737](https://github.com/rust-lang/rust-clippy/pull/13737#discussion_r1875118516).)
- It causes Clippy to no longer suggest deprecated configurations.
(Previously, Clippy would suggest `cyclomatic-complexity-threshold`, for
example.)

r? @y21

changelog: Rename `lint-inconsistent-struct-field-initializers` to
`check-inconsistent-struct-field-initializers`
changelog: No longer suggest deprecated configurations
2025-03-25 11:56:47 +00:00
Timo
9c6cb5150f
wildcard_imports: lint on pub use if asked to (#14182)
`warn_on_all_wildcard_imports` should warn on all wildcard imports,
including the reexported ones.

Fix #13660

changelog: [`warn_on_all_wildcard_imports`]: when asked to warn on all
wildcard imports, include the reexported ones
2025-03-25 00:08:45 +00:00
Samuel Tardieu
809c931804 wildcard_imports: lint on pub use if asked to
`warn_on_all_wildcard_imports` should warn on all wildcard imports,
including the reexported ones.
2025-03-24 15:49:29 +01:00
blyxyas
ca3177c458 Move back date 6 weeks 2025-03-24 00:51:56 +01:00
Samuel Moelius
88b590bf46 lint-inconsistent-... -> check-inconsistent-... 2025-03-23 15:22:37 -04:00