Пытаюсь скомпилировать пример:
use std::fs::File;
fn main() {
let f = try!(File::open("in.txt"));
}
Но, он падает с ошибкой
<std macros>:5:8: 6:42 error: mismatched types:
expected `()`,
found `core::result::Result<_, _>`
(expected (),
found enum `core::result::Result`) [E0308]
<std macros>:5 return $ crate:: result:: Result:: Err (
<std macros>:6 $ crate:: convert:: From:: from ( err ) ) } } )
<std macros>:1:1: 6:48 note: in expansion of try!
sum.rs:4:13: 4:39 note: expansion site
error: aborting due to previous error
Версия 1.0.0-nightly (47def3ef2 2015-04-13) (built 2015-04-12)