about summary refs log tree commit diff
path: root/tests/ui/specialization/prefer-specializing-impl-over-default.rs
blob: af6837b30cafa5eade28b764874c496dd66fa148 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
//@ check-pass
#![feature(specialization)]
//~^ WARN the feature `specialization` is incomplete

trait WithAssoc: 'static {
    type Assoc;
}
impl<T: 'static> WithAssoc for (T,) {
    type Assoc = ();
}

struct GenericArray<U: WithAssoc>(U::Assoc);

trait AbiExample {
    fn example();
}
impl<U: WithAssoc> AbiExample for GenericArray<U> {
    fn example() {}
}
impl<T> AbiExample for T {
    default fn example() {}
}

fn main() {
    let _ = GenericArray::<((),)>::example();
}