Created
December 22, 2014 11:00
-
-
Save pyfisch/b05359397660949199e1 to your computer and use it in GitHub Desktop.
Rust crash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let testvector = vec![1, 2, 3]; | |
let a: int = testvector[-1]; | |
println!("{}", a); | |
} | |
/* The output: | |
task '<main>' panicked at 'index out of bounds: the len is 3 but the index is 18446744073709551615', /xxxx/src/main.rs:1 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment