Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- println!("{:?}", {
- fn foo() -> Result<Vec<i32>, i32> { let vec = (0..32).map(|n| if n % 17 != 0 { Ok(n) } else { Err(n) }).collect()?; vec }
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (file:///playground)
- error[E0284]: type annotations required: cannot resolve `<_ as std::ops::Try>::Ok == _`
- --> src/main.rs:5:55
- |
- 5 | fn foo() -> Result<Vec<i32>, i32> { let vec = (0..32).map(|n| if n % 17 != 0 { Ok(n) } else { Err(n) }).collect()?; vec }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- error: aborting due to previous error
- For more information about this error, try `rustc --explain E0284`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Add Comment
Please, Sign In to add comment