You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add new lint: `ref_as_ptr`
Fixesrust-lang#10130
Added new lint `ref_as_ptr` that checks for conversions from references to pointers and suggests using `std::ptr::from_{ref, mut}` instead.
The name is different than suggested in the issue (`as_ptr_cast`) since there were some other lints with similar names (`ptr_as_ptr`, `borrow_as_ptr`) and I wanted to follow the convention.
Note that this lint conflicts with the `borrow_as_ptr` lint in the sense that it recommends changing `&foo as *const _` to `std::ptr::from_ref(&foo)` instead of `std::ptr::addr_of!(foo)`. Personally, I think the former is more readable and, in contrast to `addr_of` macro, can be also applied to temporaries (cf. rust-lang#9884).
---
changelog: New lint: [`ref_as_ptr`]
[rust-lang#12087](rust-lang/rust-clippy#12087)
Most of the tests have been disabled so flatpipes is pretty busted. This can be reimplemented on top of the new I/O system later.
The text was updated successfully, but these errors were encountered: