changelog: [`unwrap_used`, `expect_used`]: lint even when the receiver
is a macro expansion result
This also paves the way for expanding more method call lints to expanded
receivers or arguments.
Fixesrust-lang/rust-clippy#13455
fixrust-lang/rust-clippy#13637
As suggested in the PR above, we should not lint enum variants
containing matching path names.
changelog: [`item_name_repetitions`]: exclude enum variants with
identical path components
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.
The MSRV being for crates targeting 1.85-1.87 on edition 2024
This enables the lint for regular nightly users without the feature gate
enabled
r? @samueltardieu
Fixes https://github.com/rust-lang/rust-clippy/issues/14678
changelog: none
I'm working on https://github.com/rust-lang/rust-clippy/issues/14542 and
I decided to name the lint `unnecessary_map` originally. However when I
ran the command, I got:
```
thread 'main' panicked at clippy_dev/src/new_lint.rs:450:5:
Lint `unnecessary_map` already defined in `/home/imperio/rust/clippy/clippy_lints/src/methods/mod.rs`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
It's because there is already a `unnecessary_map_or`, which matches the
`.contains()` call. This PR strengthens this check.
changelog: Fix `new_lint` clippy command
r? @flip1995
Remove `weak` alias terminology
I find the "weak" alias terminology to be quite confusing. It implies the existence of "strong" aliases (which do not exist) and I'm not really sure what about weak aliases is "weak". I much prefer "free alias" as the term. I think it's much more obvious what it means as "free function" is a well defined term that already exists in rust.
It's also a little confusing given "weak alias" is already a term in linker/codegen spaces which are part of the compiler too. Though I'm not particularly worried about that as it's usually very obvious if you're talking about the type system or not lol. I'm also currently trying to write documentation about aliases and it's somewhat awkward/confusing to be talking about *weak* aliases, when I'm not really sure what the basis for that as the term actually *is*.
I would also be happy to just find out there's a nice meaning behind calling them "weak" aliases :-)
r? `@oli-obk`
maybe we want a types MCP to decide on a specific naming here? or maybe we think its just too late to go back on this naming decision ^^'
Closesrust-lang/rust-clippy#14577.
Migrate this lint to late pass and avoids `unit_never_type_fallback`
since it is no longer permitted in Rust 2024.
changelog: [`unused_unit`] fix wrong suggestions when unit never type
fallback
here is my small fix
changelog: fix suggestion span to avoid showing macro name in
`.div_ceil()` suggestion
i changed this line
`let divisor_snippet = snippet_with_applicability(cx,
rhs.spansource_callsite(), "..", applicability);`
to this line
`let divisor_snippet = snippet_with_applicability(cx, rhs.span, "..",
applicability);`
to fix problem where this warning in macro expands like this
```rust
4 | let _ = (x + 7) / 8;
| ^^^^^^^^^^^ help: consider using `.div_ceil()`: `x.div_ceil(y!())`
```
[play it
yourself](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=397aa8cd2ffffb24a286fbddbc75446c)
as you can see here it looks like `x.div_ceil(y!())` and contains macro
signature
so i fixed this problem, i will look closely if there any more problems
like this and fix them in order
**Related issue**
fixes
[rust-lang/rust-clippy#14665](https://github.com/rust-lang/rust-clippy/issues/14665)