2016-01-21 03:57:21 -06:00
|
|
|
// Test new Index error message for slices
|
|
|
|
|
2016-05-16 15:16:52 -05:00
|
|
|
use std::ops::Index;
|
|
|
|
|
2018-10-30 18:18:11 -05:00
|
|
|
|
2016-01-21 03:57:21 -06:00
|
|
|
fn main() {
|
|
|
|
let x = &[1, 2, 3] as &[i32];
|
2016-07-19 03:50:52 -05:00
|
|
|
x[1i32]; //~ ERROR E0277
|
|
|
|
x[..1i32]; //~ ERROR E0277
|
2016-01-21 03:57:21 -06:00
|
|
|
}
|