Skip to content

Conversation

@flip1995
Copy link
Member

r? @Manishearth

Cargo.lock update due to Clippy version bump.

ada4a and others added 30 commits October 20, 2025 19:58
they are much readable this way imo
This is a general advice, and so shouldn't be repeated
This makes the labels redundant.
Add a new lint that detects the use of decimal literals as bit masks in
bitwise operations. Using decimal literals for bit masks can obscure the
intended bit pattern and reduce code readability. This lint encourages
the use of binary (`0b...`) or hexadecimal (`0x...`) notation to make
bit patterns explicit and easier to understand at a glance.

Example:

```rust
let masked = x & 14; // Bad: decimal literal as bit mask
let masked = x & 0b1110; // Good: bit pattern is explicit
```

changelog: [`decimal_bitwise_operands`]: new lint

Fixes rust-lang/rust-clippy#1775
Related to
https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast
(and very much modelled off of its implementation).

This lint is motivated by cleaning up the output of
[c2rust](https://c2rust.com/), which contains many `.offset` calls with
by literal. The lint also nicely handles offsets by zero, which are
unnecessary.

I'm aware that the feature freeze is still in place, but this was
top-of-mind now. I'll patiently wait until the freeze is lifted.

changelog: [`ptr_offset_by_literal`]: add `ptr_offset_by_literal` lint
…15101)

Closes rust-lang/rust-clippy#15099

The compiler will generate a special `main` function for the tests,
which caused this FP.

changelog: [`large_stack_frames`] fix FP on compiler generated targets
Now the program checks for transmutting from a struct containing a
single raw pointer to a reference.

```Rust
struct Foo(*const i32);
fn foo(foo: Foo) -> &i32 {
    unsafe { transmute(foo) }
}
```

changelog: [`transmute_ptr_to_ref`]: now checks for a pointer wrapped in
a struct
Now the program checks for transmutting from a struct containing a
single raw pointer to a raw pointer.

changelog: [`transmute_ptr_to_ptr`]: now checks for a pointer wrapped in
a struct
Before this PR:

<img width="722" height="306" alt="Screenshot From 2025-11-28 13-04-55"
src="https://github.com/user-attachments/assets/8c2d1eb2-6030-43d1-984a-174988c73e76"
/>

With this PR:

<img width="722" height="306" alt="Screenshot From 2025-11-28 13-05-01"
src="https://github.com/user-attachments/assets/ae8a344f-b876-44b3-9ddc-aaeebc0dccd4"
/>

r? @Alexendoo

changelog: Fix display of dropdown menu "buttons"
Jarcho and others added 21 commits December 9, 2025 03:44
…ns to remove while-let loops (rust-lang#16100)

Fixes rust-lang/rust-clippy#16019 by reborrowing, instead of using
by_ref, when the iterator expression is not `Sized`.

```
changelog: [`while_let_on_iterator`]: fixes broken suggestion by using reborrow instead of `by_ref` for references to traits that are not `Sized`
```
```
error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
  --> $DIR/dyn-trait-type-alias-return-type.rs:4:11
   |
LL | fn f() -> T { loop {} }
   |           ^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`
note: this type alias is unsized
  --> $DIR/dyn-trait-type-alias-return-type.rs:1:1
   |
LL | type T = dyn core::fmt::Debug;
   | ^^^^^^
   = note: the return type of a function must have a statically known size
```
…version (rust-lang#16197)

Closes rust-lang/rust-clippy#16192

changelog: [`tuple_array_conversions`] fix FP when binded vars are used
before conversion
Closes: rust-lang/rust-clippy#16204

----

changelog: Fix typo in deprecated lint `string_to_string` message
Clippy should warn when a const, static, or let binding is defined as
one integer type but immediately/ consistently cast to another type at
usage sites without any usage of the original type. fixes
rust-lang/rust-clippy#16137

changelog: [`needless_type_cast `]: suggests defining bindings as their
cast type
Violets are red,
Roses are blue,
Snowflakes dance softly,
And winter winds brew.

--------
Alaska breaking time and space from @kyotuca is the winner at
rust-lang/rust-clippy#15971

<img width="1134" height="1495" alt="image"
src="https://github.com/user-attachments/assets/d7878cfa-c285-4af2-af3b-26c737d57b1c"
/>

--------

Cats for the next release can be traditionally nominated in the
comments.

changelog: none

r? flip1995
…t-lang#15948)

Fixes rust-lang/rust-clippy#1966.

Now the program checks for transmutting from a struct containing a
single raw pointer to a reference.

```Rust
struct Foo(*const i32);
fn foo(foo: Foo) -> &i32 {
    unsafe { transmute(foo) }
}
```

changelog: [`transmute_ptr_to_ref`]: now checks for a pointer wrapped in
a struct
…st-lang#15876)

Fixes rust-lang/rust-clippy#15841

changelog: [`match_like_matches_macro`]: FP with guards containing `if
let`
…default()` (rust-lang#15845)

Resolves rust-lang/rust-clippy#15655

changelog: [`manual_saturating_arithmetic`]: lint
`x.checked_sub(y).unwrap_or_default()`
Experimentally add *heterogeneous* `try` blocks

rust-lang#148725 moved the default to being homogeneous; this adds heterogeneous ones back under an obvious-bikeshed syntax so people can experiment with that as well.

Essentially resolves rust-lang#149025 by letting them move to this syntax instead.

New tracking issue: rust-lang#149488
Related RFC: rust-lang/rfcs#3721 (comment) (specifically about experimenting)
r? @ghost

changelog: none
@rustbot
Copy link
Collaborator

rustbot commented Dec 11, 2025

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. labels Dec 11, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 11, 2025

⚠️ Warning ⚠️

@samueltardieu
Copy link
Member

@bors r+ rollup=never p=1 subtree update

@bors
Copy link
Collaborator

bors commented Dec 11, 2025

📌 Commit 26c164f has been approved by samueltardieu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-clippy Relevant to the Clippy team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.