We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Given:
use std::cell::Cell; pub struct V<'v>(Cell<&'v ()>); pub unsafe fn downcast_v<'v>(x: V<'static>) -> V<'v> { std::mem::transmute(x) }
If you enable -D clippy::useless-transmute then Clippy warns:
-D clippy::useless-transmute
error: transmute from a type (`foo:V`) to itself
But it's actually V<'static> to V<'v>, so a transmute is required.
V<'static>
V<'v>
$ cargo clippy -V clippy 0.0.212 (891e1a85 2020-04-18)
The text was updated successfully, but these errors were encountered:
Duplicate of #5343
Sorry, something went wrong.
No branches or pull requests
Given:
If you enable
-D clippy::useless-transmute
then Clippy warns:But it's actually
V<'static>
toV<'v>
, so a transmute is required.The text was updated successfully, but these errors were encountered: