Closed
Description
This looks like a bug to me. No one responded on IRC so I'm uncertain though:
#[derive(Debug)]
struct S {
val: Option<Box<S>>,
}
fn main() {
let mut a = S { val: None };
let _ = S { val: Some(Box::new(a)) };
// `a` was just moved. I can still assign to it though.
// kinda seems like a bug.
a.val = None;
// assignment works but println fails because of move. kinda weird.
//println!("{:?}", a.val);
}
Metadata
Metadata
Assignees
Labels
No labels