Fix internal `default_hash_types` lint to use resolved path
I run into false positives now and then (mostly in Clippy) when I want to name some util after HashMap.
Refactor `format_args!` expansion parsing
Introduces `FormatExpn::parse` and `FormatArgsExpn::parse`. Motivated by rust-lang/rust#83302, so I only have to change Clippy in one place. Fixed an FP along the way.
I also allowed `needless_bool` in macros because I often want to do `if_chain! { .. then { true } else { false } }`.
changelog: Fix false positive in `useless_format` when some text is appended or prepended to a single string with some useless formatting params
changelog: Allow `needless_bool` in macros
Remove lints_enabled
r? `@camsteffen`
cc https://github.com/rust-lang/rust-clippy/pull/7448#issuecomment-876497862
I haven't added a variant with `last_node_with_lint_attrs` yet, since I didn't see a usecase for this. Also this field is not documented, so I'm wondering how it behaves with command line lints and so on.
changelog: none
Rename run_lints -> lints_enabled
Just a quick rename of a utilities function. `run_lints` kinda suggested that the lints were run by this function. But the only thing this function does is to check if the lints are enabled in the context of the `hir_id`
changelog: none
Fix false-positive `assert` in `panic`
This PR fixes a false-positive in `clippy::panic` when using the `assert` macro with its optional message parameter.
Fixes: #7433
changelog: `panic_unimplemented.rs`: added condition to exclude `assert` macro, similar to `debug_assert`
changelog: `panicking_macros.rs`: relevant tests to check for `assert` usage.
Add new lint: `strlen_on_c_strings`
~~This is WIP, linting in case of `CString` has been added, but for `CStr`, its diagnostic item needs to be available for clippy.
[PR that adds diagnostic item for CStr on rust repo](https://github.com/rust-lang/rust/pull/85439).~~
Ready for the review. Please take a look.
fixes#7145
changelog: Add new lint: `strlen_on_c_strings`, that lints on `libc::strlen(some_cstring.as_ptr())`
Downgrade nonstandard_macro_braces to nursery
Due to the large number of crates impacted by #7422, I don't think this lint can be enabled by default right now until the false positive is fixed.
---
changelog: remove [`nonstandard_macro_braces`] from default set of enabled lints