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