blob: 5c2a3f80170eaa0b84299ef5db5a62589ce1c2bb (
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
30
31
|
#![feature(const_trait_impl, min_specialization, rustc_attrs)]
#[rustc_specialization_trait]
#[const_trait]
pub trait Sup {}
impl const Sup for () {}
#[const_trait]
pub trait A {
fn a() -> u32;
}
#[const_trait]
pub trait Spec {}
impl<T: ~const Spec> const A for T {
default fn a() -> u32 {
2
}
}
impl<T: Spec + Sup> A for T {
//~^ ERROR: cannot specialize
//~| ERROR: missing `~const` qualifier
fn a() -> u32 {
3
}
}
fn main() {}
|