Suggest pointer::cast when possible in transmute_ptr_to_ref#8939
Suggest pointer::cast when possible in transmute_ptr_to_ref#8939bors merged 1 commit intorust-lang:masterfrom
pointer::cast when possible in transmute_ptr_to_ref#8939Conversation
|
r? @giraffate (rust-highfive has picked a reviewer for you, use r? to override) |
|
Apparently casting |
giraffate
left a comment
There was a problem hiding this comment.
Sorry for the late reviewing. I made comments.
clippy_utils/src/msrvs.rs
Outdated
| 1,38,0 { POINTER_CAST } | ||
| 1,37,0 { TYPE_ALIAS_ENUM_VARIANTS } | ||
| 1,36,0 { ITERATOR_COPIED } | ||
| 1,36,0 { ITERATOR_COPIED, PTR_CAST } |
There was a problem hiding this comment.
What method is this? I thought it was this, but it looks like this was added at 1.38.0.
There was a problem hiding this comment.
That is the right method. I don't know where I got 1.36 from.
There was a problem hiding this comment.
Okay. Can 1,38,0 { POINTER_CAST } be used for msrv?
Defensively add a cast to any type with lifetimes.
20e0273 to
7cdaabc
Compare
|
@bors r+ It looks good, thanks! |
|
📌 Commit 7cdaabc has been approved by |
|
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
fixes #8924
changelog: Suggest casting the pointer for any type containing lifetimes in
transmute_ptr_to_ref.changelog: Suggest
pointer::castwhen possible intransmute_ptr_to_ref.