You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, the constant C is presumed not to need drop (the example can be easily adapted to other qualifs & situations):
#![feature(const_mut_refs)]#![feature(const_precise_live_drops)]#![feature(const_swap)]pubconstC:Option<String> = {letmut x = None;letmut y = Some(String::new());let a = &mut x;let b = &mut y;
std::mem::swap(a, b);
std::mem::forget(y);
x
};pubconstD:() = {C;};