rust-clippy
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/
#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...
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
### Summary Consider the following code: ```rust // SAFETY: trust me ok long_var_name = unsafe { /* ... */ }; ``` Normally, `rustfmt` will either leave the `unsafe` block as...
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...
**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...
### 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"...
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)
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`
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...
fixes #12909. *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: [`default_trait_access`]: fix incorrect code suggestion