What? No it doesn't.
fn square(n: i32) -> i32 { n * n }
Though in this case it's more like knowing that the specific way you call the function in foo.rs will never get back a -2.
fn bar(n: i32, allow_negative: bool) -> i32 { let new = n * 2; if allow_negative || new >= 0 { new } else { 0 } } bar(x, false)
What? No it doesn't.
This method cannot return -2.Though in this case it's more like knowing that the specific way you call the function in foo.rs will never get back a -2.