fn main() {
let foo = String::new("FOO");
let foo = match 0 {
0 if { some_func(foo) } => unreachable!(),
_ => { foo }
};
println!("{:#?}", foo);
fn some_func(bar: String) -> bool {
drop(bar);
false
}
This program prints a garbage on the screen with a "Segmentation fault"
let foo = String::new("FOO");
let foo = match 0 {
0 if { some_func(foo) } => unreachable!(),
_ => { foo }
};
println!("{:#?}", foo);
fn some_func(bar: String) -> bool {
drop(bar);
false
}
This program prints a garbage on the screen with a "Segmentation fault"
Comments
Post a Comment