rust: enable `clippy::ref_as_ptr` lint
authorTamir Duberstein <tamird@gmail.com>
Sun, 15 Jun 2025 20:55:10 +0000 (16:55 -0400)
committerMiguel Ojeda <ojeda@kernel.org>
Sun, 22 Jun 2025 21:09:32 +0000 (23:09 +0200)
commitdc35ddcf97e99b18559d0855071030e664aae44d
tree6bbda26cdd492b49ffb02923532157bf040ae88b
parentb7c8d7a8d251ab63fba3cc964f1928a216c28081
rust: enable `clippy::ref_as_ptr` lint

In Rust 1.78.0, Clippy introduced the `ref_as_ptr` lint [1]:

> Using `as` casts may result in silently changing mutability or type.

While this doesn't eliminate unchecked `as` conversions, it makes such
conversions easier to scrutinize.  It also has the slight benefit of
removing a degree of freedom on which to bikeshed. Thus apply the
changes and enable the lint -- no functional change intended.

Link: https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr
Suggested-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/all/D8PGG7NTWB6U.3SS3A5LN4XWMN@proton.me/
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/20250615-ptr-as-ptr-v12-6-f43b024581e8@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Makefile
rust/bindings/lib.rs
rust/kernel/configfs.rs
rust/kernel/device_id.rs
rust/kernel/fs/file.rs
rust/kernel/str.rs
rust/kernel/uaccess.rs
rust/uapi/lib.rs