]> git.lizzy.rs Git - rust.git/blob - tests/ui/methods/method-two-traits-distinguished-via-where-clause.rs
Rollup merge of #107499 - compiler-errors:deduce_sig_from_projection-generator-tweak...
[rust.git] / tests / ui / methods / method-two-traits-distinguished-via-where-clause.rs
1 // run-pass
2 // Test that we select between traits A and B. To do that, we must
3 // consider the `Sized` bound.
4
5 // pretty-expanded FIXME #23616
6
7 trait A {
8     fn foo(self);
9 }
10
11 trait B {
12     fn foo(self);
13 }
14
15 impl<T: Sized> A for *const T {
16     fn foo(self) {}
17 }
18
19 impl<T> B for *const [T] {
20     fn foo(self) {}
21 }
22
23 fn main() {
24     let x: [isize; 4] = [1,2,3,4];
25     let xptr = &x[..] as *const [isize];
26     xptr.foo();
27 }