2014-09-15 03:48:58 -05:00
|
|
|
// Test that slicing syntax gives errors if we have not implemented the trait.
|
|
|
|
|
|
|
|
struct Foo;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = Foo;
|
2017-06-09 12:05:14 -05:00
|
|
|
&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`
|
2014-09-17 16:33:31 -05:00
|
|
|
}
|