#![warn(clippy::transmute_ptr_to_ptr)]
-#![allow(clippy::transmutes_expressible_as_ptr_casts)]
+
// Make sure we can modify lifetimes, which is one of the recommended uses
// of transmute
let _: &GenericParam<&LifetimeParam<'static>> = unsafe { std::mem::transmute(&GenericParam { t: &lp }) };
}
+// dereferencing raw pointers in const contexts, should not lint as it's unstable (issue 5959)
+const _: &() = {
+ struct Zst;
+ let zst = &Zst;
+
+ unsafe { std::mem::transmute::<&'static Zst, &'static ()>(zst) }
+};
+
fn main() {}