rust-clippy icon indicating copy to clipboard operation
rust-clippy copied to clipboard

A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/

Results 560 rust-clippy issues
Sort by recently updated
recently updated
newest added

#12746 introduced very buggy behaviour (`.fixed` tests not being checked, not showing what went wrong... etc.), this commit reverts that and it should fix all those issues. We'll check again...

S-waiting-on-review

changelog: [`pathbuf_init_then_push`]: new lint: Checks for calls to `push` immediately after creating a new `PathBuf` Just a mirror of VEC_INIT_THEN_PUSH

S-waiting-on-review

### Summary Consider the following code: ```rust // SAFETY: trust me ok long_var_name = unsafe { /* ... */ }; ``` Normally, `rustfmt` will either leave the `unsafe` block as...

C-bug
I-false-positive

Fixes https://github.com/rust-lang/rust-clippy/issues/11858 Adds a new lint which checks for an if-conditional which checks if a sequence is not empty (`!seq.is_empty()`) and, in the body of the if statement, accesses the...

S-waiting-on-review

**NOTE:** This is using `cargo clippy`, but the actual issue may be in the `lint_reasons` feature. If this is not appropriate for the rustc repo, let me know and I...

C-bug
A-lint
A-clippy

### What it does It's a major footgun to subtract `Duration`s from `Instant`s . On a bunch of targets `Instant` is quite close to the "beginning of time" / "0"...

A-lint

Adds redundant_test_prefix lint, which checks test names for the `test_` prefix, and warns if found. Closes https://github.com/rust-lang/rust-clippy/issues/8931 changelog: New Lint: [`redundant_test_prefix`] [#12861](https://github.com/rust-lang/rust-clippy/pull/12861)

S-waiting-on-author

Based off the changes in #11787. Still a fair bit of work to do to catch more patterns. changelog: Add new lint `manual_checked_op`

S-blocked

Those were outdated anyway. Now with switching to Josh, the documentation should also be updated, as a lot of things got simplified. This updates the documentation on how to do...

S-waiting-on-author

fixes #12909. *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: [`default_trait_access`]: fix incorrect code suggestion

S-waiting-on-author