blob: 5423e295a87739424b8b18cc62244e8ca3ea3fe1 [file] [log] [blame]
// Test that slicing syntax gives errors if we have not implemented the trait.
struct Foo;
fn main() {
let x = Foo;
&x[..]; //~ ERROR cannot index into a value of type `Foo`
&x[Foo..]; //~ ERROR cannot index into a value of type `Foo`
&x[..Foo]; //~ ERROR cannot index into a value of type `Foo`
&x[Foo..Foo]; //~ ERROR cannot index into a value of type `Foo`
}