This code will compile (see https://play.rust-lang.org/?version=stable&mode=debug&editio...):
pub fn foo() -> Result<(), i64> {
Err(1)
}
pub fn bar() -> Result<(), ()> {
foo();
Ok(())
}
It will provide a warning, but there's a ton of stuff in c++ that would throw a warning and you wouldn't say that it "will not compile".A trivial change that still doesn't handle the error would get rid of the warning.
pub fn foo() -> Result<(), i64> {
Err(1)
}
pub fn bar() -> Result<(), ()> {
println!("{:?}", foo());
Ok(())
}