diff options
author | Tamir Duberstein <tamird@gmail.com> | 2025-06-15 16:55:06 -0400 |
---|---|---|
committer | Miguel Ojeda <ojeda@kernel.org> | 2025-06-22 23:08:50 +0200 |
commit | d8c9e735f1f3e729268222a550de7a7f594c4210 (patch) | |
tree | 9569868d96ea1b40f759a67c8628896e24639b9f /tools/perf/scripts/python/task-analyzer.py | |
parent | fcad9bbf9e1a7de6c53908954ba1b1a1ab11ef1e (diff) |
rust: enable `clippy::ptr_cast_constness` lint
In Rust 1.72.0, Clippy introduced the `ptr_cast_constness` lint [1]:
> Though `as` casts between raw pointers are not terrible,
> `pointer::cast_mut` and `pointer::cast_const` are safer because they
> cannot accidentally cast the pointer to another type.
There are only 3 affected sites:
- `*mut T as *const U as *mut U` becomes `(*mut T).cast()`.
- `&self as *const Self as *mut Self` becomes
`core::ptr::from_ref(self).cast_mut()`.
- `*const T as *mut _` becommes `(*const T).cast_mut()`.
Apply these changes and enable the lint -- no functional change
intended.
Link: https://rust-lang.github.io/rust-clippy/master/index.html#ptr_cast_constness [1]
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-2-f43b024581e8@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions