Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- let n = "10".parse().unwrap(); &[0, 1, 2, 3][4-n..]
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- error[E0282]: type annotations needed
- --> src/main.rs:6:13
- |
- 6 | let n = "10".parse().unwrap(); &[0, 1, 2, 3][4-n..]
- | ^
- | |
- | cannot infer type
- | consider giving `n` a type
- error: aborting due to previous error
- For more information about this error, try `rustc --explain E0282`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Add Comment
Please, Sign In to add comment