solar_data_structures/trustme.rs
1#![allow(clippy::missing_transmute_annotations)]
2#![allow(clippy::missing_safety_doc)]
3
4/// Changes the lifetime of the given reference.
5pub unsafe fn decouple_lt<'a, T: ?Sized>(x: &T) -> &'a T {
6 unsafe { std::mem::transmute(x) }
7}
8
9/// Changes the lifetime of the given mutable reference.
10pub unsafe fn decouple_lt_mut<'a, T: ?Sized>(x: &mut T) -> &'a mut T {
11 unsafe { std::mem::transmute(x) }
12}