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
With rust 0.6, the following code produces a segfault. Indeed, at the time of println, *y is no longer a managed pointer to a string, but an arbitrary value crafted by the closure.
enum A { B(@str), C(int) }
fn main() -> () {
let mut x = B(@"");
let f = || { x = C(0); };
match x {
B(ref y) => { f(); println(*y) },
C(*) => ()
}
}
The text was updated successfully, but these errors were encountered:
With rust 0.6, the following code produces a segfault. Indeed, at the time of println, *y is no longer a managed pointer to a string, but an arbitrary value crafted by the closure.
The text was updated successfully, but these errors were encountered: