mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
11 lines
175 B
Rust
11 lines
175 B
Rust
// Test new Index error message for slices
|
|
|
|
use std::ops::Index;
|
|
|
|
|
|
fn main() {
|
|
let x = &[1, 2, 3] as &[i32];
|
|
x[1i32]; //~ ERROR E0277
|
|
x[..1i32]; //~ ERROR E0277
|
|
}
|