2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2014-11-05 21:06:04 -06:00
|
|
|
// Test that we select between traits A and B. To do that, we must
|
|
|
|
// consider the `Sized` bound.
|
|
|
|
|
2015-03-22 15:13:15 -05:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2014-11-05 21:06:04 -06:00
|
|
|
trait A {
|
|
|
|
fn foo(self);
|
|
|
|
}
|
|
|
|
|
|
|
|
trait B {
|
|
|
|
fn foo(self);
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T: Sized> A for *const T {
|
|
|
|
fn foo(self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T> B for *const [T] {
|
|
|
|
fn foo(self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2015-03-25 19:06:52 -05:00
|
|
|
let x: [isize; 4] = [1,2,3,4];
|
2015-03-30 13:00:05 -05:00
|
|
|
let xptr = &x[..] as *const [isize];
|
2014-11-05 21:06:04 -06:00
|
|
|
xptr.foo();
|
|
|
|
}
|