MCPcopy Create free account
hub / github.com/Apress/beginning-rust-2e / main

Function main

Source Code/06-10.rs:6–16  ·  view source on GitHub ↗

ILLEGAL. The compiler prints the three error messages: the type `[{integer}]` cannot be indexed by `isize` the type `[{integer}]` cannot be indexed by `u32` the type `[{integer}]` cannot be indexed by `u64` */

()

Source from the content-addressed store, hash-verified

4the type `[{integer}]` cannot be indexed by `u64`
5*/
6fn main() {
7 let arr = [11, 22, 33];
8 let i: usize = 2;
9 print!("{}", arr[i]);
10 let i: isize = 2;
11 print!("{}", arr[i]);
12 let i: u32 = 2;
13 print!("{}", arr[i]);
14 let i: u64 = 2;
15 print!("{}", arr[i]);
16}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected