- 07 4月, 2022 6 次提交
-
-
由 Paolo Borelli 提交于
Add a lint to detect cast to unsigned for abs() and suggest unsigned_abs() to avoid panic when called on MIN.
-
由 bors 提交于
Add lints `drop_non_drop` and `forget_non_drop` fixes #1897 changelog: Add lints `drop_non_drop` and `forget_non_drop`
-
由 bors 提交于
Add [`err_expect`] lint [`expect_err`] lint - \[ ] Followed [lint naming conventions][lint_naming] - \[x] Added passing UI tests (including committed `.stderr` file) - \[x] `cargo test` passes locally - \[x] Executed `cargo dev update_lints` - \[x] Added lint documentation - \[x] Run `cargo dev fmt` Fixes https://github.com/rust-lang/rust-clippy/issues/1435 changelog: Added a lint to detect usage of .err().expect()
-
由 infrandomness 提交于
- err() was meant to be employed instead of ok() - wraps comment
-
由 InfRandomness 提交于
-
由 bors 提交于
fix FP in lint `[needless_match]` fixes: #8542 fixes: #8551 fixes: #8595 fixes: #8599 --- changelog: check for more complex custom type, and ignore type coercion in [`needless_match`]
-
- 06 4月, 2022 7 次提交
-
-
由 bors 提交于
update unnecessary_join documentation changelog: none Updates the description of `unnecessary_join` in accordance with https://github.com/rust-lang/rust-clippy/pull/8579#issuecomment-1089969859. I've also added a line regarding differences in assembly output, please let me know if it should also make it in.
-
由 Yoav Lavi 提交于
-
由 J-ZhengLi 提交于
-
由 bors 提交于
Suggest from_utf8_unchecked in const contexts Unfortunately I couldn't figure out how to check whether a given expression is in an `unsafe` context or not, so I just unconditionally emit the wrapping `unsafe {}` block in the suggestion. If there is an easy way to get it to work better then I would love to hear it. changelog: Suggest `from_utf8_unchecked` instead of `from_utf8` in const contexts for ``[`transmute_bytes_to_str`]`` refs: #8379
-
由 Sabrina Jewson 提交于
Co-authored-by: NPhilipp Krones <hello@philkrones.com>
-
由 bors 提交于
Fix unnecessary_cast suggestion for type aliasses Fix #6923. The [`unnecessary_cast`] lint now will skip casting to non-primitive type. changelog: fix lint [`unnecessary_cast `]
-
由 bors 提交于
`indexing_slicing` should not fire if a valid array index comes from a constant function that is evaluated at compile-time fix #8348 changelog: [`indexing_slicing`] fewer false positives in `const` contexts and with `const` indices
-
- 05 4月, 2022 11 次提交
-
-
由 bors 提交于
Add documentation on how to do a minimal changelog update This ensures that the link to the Clippy version in the Rust release blog post works correctly. The additional `(beta)` behind the previous beta version breaks that link otherwise. [Rendered](https://github.com/flip1995/rust-clippy/blob/release_changelog_quick_update/doc/release.md) changelog: none
-
由 bors 提交于
fix misspelling in diagnostic message of `bytes_nth` *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: fix misspelling in diagnostic message in ``[`bytes_nth`]``
-
由 Akshay 提交于
-
由 bors 提交于
Run fmt test before compile-test/dogfood I seem to always forget to run `cargo dev fmt` before doing a test. This lets it fail fast rather than going through the much longer compile-test/dogfood tests first changelog: none
-
由 bors 提交于
Allow running `cargo dev lint` on a package directory Allows you run the local clippy in a specified directory, e.g. allowing ```sh # Lint a ui-cargo test cargo dev lint tests/ui-cargo/wildcard_dependencies/fail # Lint some other project cargo dev lint ~/my-project ``` The `target` directory is set to a tempdir which isn't ideal for medium/large projects as it would be compiled from scratch. This is to avoid cached clippy messages where you `cargo dev lint dir`, change something in clippy, and run `cargo dev lint dir` again changelog: Dev: `cargo dev lint` can now be run on a package directory
-
由 flip1995 提交于
This ensures that the link to the Clippy version in the Rust release blog post works correctly. The additional `(beta)` behind the previous beta version breaks that link otherwise.
-
由 bors 提交于
Escape `mod.rs` file mentions to avoid links in our documentation As the title says nothing special, still a fun fix :) Closes: #8627 changelog: none
-
由 xFrednet 提交于
We can read them if they want to start sponsoring us xD
-
由 bors 提交于
Don't lint `cast_ptr_alignment` when used for unaligned reads and writes fixes #2881 Ideally this would trace the usage of the value rather than only looking at the parent expression, but that would require dataflow analysis. e.g. ```rust let x = ptr as *const u16; c.read_unaligned(x); ``` Arch specific intrinsic functions need to be checked for ones which could take an unaligned pointer. This can be another PR. changelog: Don't lint `cast_ptr_alignment` when used for unaligned reads and writes
-
由 Jason Newcomb 提交于
-
由 Jason Newcomb 提交于
-
- 04 4月, 2022 3 次提交
-
-
由 bors 提交于
Rework `undocumented_unsafe_blocks` fixes: #8264 fixes: #8449 One thing came up while working on this. Currently comments on the same line are supported like so: ```rust /* SAFETY: reason */ unsafe {} ``` Is this worth supporting at all? Anything other than a couple of words doesn't really fit well. edit: [zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/.60undocumented_unsafe_blocks.60.20same.20line.20comment) changelog: Don't lint `undocumented_unsafe_blocks` when the unsafe block comes from a proc-macro. changelog: Don't lint `undocumented_unsafe_blocks` when the preceding line has a safety comment and the unsafe block is a sub-expression.
-
由 bors 提交于
add `empty_structs_with_brackets` <!-- Thank you for making Clippy better! We're collecting our changelog from pull request descriptions. If your PR only includes internal changes, you can just write `changelog: none`. Otherwise, please write a short comment explaining your change. Also, it's helpful for us that the lint name is put into brackets `[]` and backticks `` ` ` ``, e.g. ``[`lint_name`]``. If your PR fixes an issue, you can add "fixes #issue_number" into this PR description. This way the issue will be automatically closed when your PR is merged. If you added a new lint, here's a checklist for things that will be checked during review or continuous integration. - \[ ] Followed [lint naming conventions][lint_naming] - \[ ] Added passing UI tests (including committed `.stderr` file) - \[ ] `cargo test` passes locally - \[ ] Executed `cargo dev update_lints` - \[ ] Added lint documentation - \[ ] Run `cargo dev fmt` [lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints Note that you can skip the above if you are just opening a WIP PR in order to get feedback. Delete this line and everything above before opening your PR. -- *Please write a short comment explaining your change (or "none" for internal only changes)* --> Closes #8591 I'm already sorry for the massive diff
😅 changelog: New lint [`empty_structs_with_brackets`] -
由 Max Baumann 提交于
-
- 02 4月, 2022 8 次提交
-
-
由 Alex Macleod 提交于
-
由 bors 提交于
Remove deps This remove both `regex` and `cargo_metadata` as dependencies making `clippy_dev` compile ~3x faster (~46s -> ~16s locally). `cargo_metadata` was used to extract the `version` field from `Cargo.toml`, which is done trivially without that. `regex` was used to parse `define_clippy_lint` in `update_lints` which is now done using `rustc_lexer`. This isn't any simpler, but it compiles ~15s faster and runs ~3x faster (~2.1s -> ~0.7s locally). The next biggest offenders to compile times are `clap` and `winapi` on windows. `clap` could be removed, but re-implementing enough is probably more work than it's worth. `winapi` is used by `opener` and `walkdir` so it's stuck there. changelog: none
-
由 bors 提交于
Handle relative paths in module_files lints The problem being that when clippy is run in the project's directory `lp` would be a relative path, this wasn't caught by the tests as there `lp` is an absolute path. Being a relative path it did not start with `trim_src_path` and so was ignored Also allowed the removal of some `.to_os_string`/`.to_owned`s changelog: Fixes [`self_named_module_files`] and [`mod_module_files`] not linting Fixes #8123, cc `@DevinR528`
-
由 Jason Newcomb 提交于
-
由 Jason Newcomb 提交于
-
由 Jason Newcomb 提交于
-
由 Jason Newcomb 提交于
-
由 bors 提交于
single_element_loop: handle arrays for Edition2021 changelog: [`single_element_loop`] handle arrays in Edition 2021, handle `.iter_mut()` and `.into_iter()`, and wrap in parens if necessary
-
- 01 4月, 2022 2 次提交
-
-
由 Peter Jaszkowiak 提交于
also handle `.iter_mut()`, `.into_iter()`, and wrapping in parens if necessary
-
由 SabrinaJewson 提交于
-
- 31 3月, 2022 3 次提交
-
-
由 SabrinaJewson 提交于
-
由 bors 提交于
Don't warn int-to-char transmutes in const contexts changelog: Don't warn ``[`transmute_int_to_char`]`` in const contexts fixes: #8379
-
由 Max Baumann 提交于
-