mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
16 lines
432 B
Rust
16 lines
432 B
Rust
fn main() {
|
|
let tup = (0, 1, 2);
|
|
// the case where we show a suggestion
|
|
let _ = tup[0];
|
|
//~^ ERROR cannot index into a value of type
|
|
|
|
// the case where we show just a general hint
|
|
let i = 0_usize;
|
|
let _ = tup[i];
|
|
//~^ ERROR cannot index into a value of type
|
|
|
|
// the case where the index is out of bounds
|
|
let tup = (10,);
|
|
let _ = tup[3];
|
|
//~^ ERROR cannot index into a value of type
|
|
}
|