Closed
Description
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:
error: transmute from a type (`foo:V`) to itself
But it's actually V<'static>
to V<'v>
, so a transmute is required.
$ cargo clippy -V
clippy 0.0.212 (891e1a85 2020-04-18)
Metadata
Metadata
Assignees
Labels
No labels