the.bay.news

What is source of provenance for locals of async blocks?

Rust Internals
What is source of provenance for locals of async blocks?
I was looking on conditions which allow a reference to escape its block syntactically, as in the example below. // Subscription adds the reference to static BTreeMap<usize, &'static mut u32> // new_event() increments all subscribed values fn sync_test() { let mut events = 0; { let s = unsafe { Subscription::new(&mut events).unwrap() }; new_event(); new_event(); // _ = { &events }; <-- would invalidate &mut, making line below UB new_event(); ...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.