2016-05-02 02:27:21 -05:00
|
|
|
fn main() {
|
|
|
|
let tup = (0, 1, 2);
|
|
|
|
// the case where we show a suggestion
|
|
|
|
let _ = tup[0];
|
2017-06-09 12:05:14 -05:00
|
|
|
//~^ ERROR cannot index into a value of type
|
2016-05-02 02:27:21 -05:00
|
|
|
|
|
|
|
// the case where we show just a general hint
|
|
|
|
let i = 0_usize;
|
|
|
|
let _ = tup[i];
|
2017-06-09 12:05:14 -05:00
|
|
|
//~^ ERROR cannot index into a value of type
|
2023-04-08 16:32:36 -05:00
|
|
|
|
|
|
|
// the case where the index is out of bounds
|
|
|
|
let tup = (10,);
|
|
|
|
let _ = tup[3];
|
|
|
|
//~^ ERROR cannot index into a value of type
|
2016-05-02 02:27:21 -05:00
|
|
|
}
|