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
Functional record update does not mark the source as consumed, even if does not implement Copy. This means that e.g. the source's destructor will eventually be run, so the following code prints ["Heap Spray"]:
pubfnfree_and_use<T>(t:Vec<T>) -> Vec<T>{Vec{ ..t }}fnmain(){let v = vec!["Hello, World!"];let r = free_and_use(v);for _ inrange(0,65536u32){vec!["Heap Spray"];}println!("{}", r);}