Skip to content

Commit f67deb2

Browse files
committed
remove static bounds on transmute
1 parent efc68c2 commit f67deb2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/transmute.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/// Then, we overwrite the dummy variable with a `DummyEnum::A(Some(<...>))` with the object we want to transmute.
2020
/// Finally, we take the `Box<A>`, interpreted as a `Box<B>`, out of the dangling reference and we've transmuted our data!
2121
///
22-
pub fn transmute<A: 'static, B: 'static>(obj: A) -> B {
22+
pub fn transmute<A, B>(obj: A) -> B {
2323
use std::hint::black_box;
2424

2525
// The layout of `DummyEnum` is approximately
@@ -36,7 +36,7 @@ pub fn transmute<A: 'static, B: 'static>(obj: A) -> B {
3636
}
3737

3838
#[inline(never)]
39-
fn transmute_inner<A: 'static, B: 'static>(dummy: &mut DummyEnum<A, B>, obj: A) -> B {
39+
fn transmute_inner<A, B>(dummy: &mut DummyEnum<A, B>, obj: A) -> B {
4040
let DummyEnum::B(ref_to_b) = dummy else {
4141
unreachable!()
4242
};

0 commit comments

Comments
 (0)