Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- foo() -> Result<(), ()> { let foo = vec![]; let idx: Result<usize, ()> = Err(()); vec[idx?]; Ok(()) } foo()
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- error: expected one of `.`, `;`, `?`, `}`, or an operator, found `->`
- --> src/main.rs:6:15
- |
- 6 | foo() -> Result<(), ()> { let foo = vec![]; let idx: Result<usize, ()> = Err(()); vec[idx?]; Ok(()) } foo()
- | ^^ expected one of `.`, `;`, `?`, `}`, or an operator here
- error[E0425]: cannot find function `foo` in this scope
- --> src/main.rs:6:9
- |
- 6 | foo() -> Result<(), ()> { let foo = vec![]; let idx: Result<usize, ()> = Err(()); vec[idx?]; Ok(()) } foo()
- | ^^^ not found in this scope
- error: aborting due to 2 previous errors
- For more information about this error, try `rustc --explain E0425`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement