From b49e8e6ca2185396b8cd05d0b4b83b3ae6b80dae Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Tue, 5 Sep 2023 11:39:52 -0300 Subject: Update crate documentation Hopefully this clarifies things --- tests/ui/no_uaf_2.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'tests/ui/no_uaf_2.rs') diff --git a/tests/ui/no_uaf_2.rs b/tests/ui/no_uaf_2.rs index 49694b2..53e3ad8 100644 --- a/tests/ui/no_uaf_2.rs +++ b/tests/ui/no_uaf_2.rs @@ -1,9 +1,6 @@ // by steffahn -#![feature(pin_macro)] - use std::cell::Cell; -use std::pin::pin; use selfref::opaque; use selfref::Holder; @@ -25,7 +22,7 @@ fn main() { Holder::<'_, MyStructKey>::new_with(|builder| builder.build(MyStruct { cell: Default::default(), })); - let s = pin!(s); + let s = Box::pin(s); s.as_ref().operate_in(|r| { r.cell.set(&String::from("hello world")); // temporary dropped at end of this statement println!("{}", r.cell.get()) // accesses dropped `String` data -- cgit 1.4.1