From 7a4de17f272c69e1d12c4dd45013939a61dad4ad Mon Sep 17 00:00:00 2001 From: ilslv Date: Fri, 14 Jul 2023 13:02:10 +0200 Subject: [PATCH] Corrections --- tests/into.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/into.rs b/tests/into.rs index 40370192..cb85a313 100644 --- a/tests/into.rs +++ b/tests/into.rs @@ -10,13 +10,15 @@ use alloc::{ string::{String, ToString}, }; #[cfg(feature = "std")] -use std::{borrow::Cow, mem}; +use std::borrow::Cow; use derive_more::Into; use static_assertions::assert_not_impl_any; /// [`mem::transmute()`] that works in generic contexts. unsafe fn transmute(from: From) -> To { + use core::mem; + let to = unsafe { mem::transmute_copy(&from) }; mem::forget(from); to