-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggest pointer::cast
when possible in transmute_ptr_to_ref
#8939
Conversation
r? @giraffate (rust-highfive has picked a reviewer for you, use r? to override) |
Apparently casting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reviewing. I made comments.
clippy_utils/src/msrvs.rs
Outdated
@@ -25,7 +25,7 @@ msrv_aliases! { | |||
1,40,0 { MEM_TAKE, NON_EXHAUSTIVE, OPTION_AS_DEREF } | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is the right method. I don't know where I got 1.36 from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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::cast
when possible intransmute_ptr_to_ref
.