solar-data-structures 0.1.8

Common data structures and utilities for the Solar compiler
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
#![allow(clippy::missing_transmute_annotations)]
#![allow(clippy::missing_safety_doc)]

/// Changes the lifetime of the given reference.
pub unsafe fn decouple_lt<'a, T: ?Sized>(x: &T) -> &'a T {
    unsafe { std::mem::transmute(x) }
}

/// Changes the lifetime of the given mutable reference.
pub unsafe fn decouple_lt_mut<'a, T: ?Sized>(x: &mut T) -> &'a mut T {
    unsafe { std::mem::transmute(x) }
}