2023-08-06 08:20:55 -05:00
|
|
|
#![feature(const_trait_impl, effects, min_specialization, rustc_attrs)]
|
2022-09-24 15:15:19 -05:00
|
|
|
|
|
|
|
#[rustc_specialization_trait]
|
|
|
|
#[const_trait]
|
|
|
|
pub trait Sup {}
|
|
|
|
|
|
|
|
impl const Sup for () {}
|
|
|
|
|
|
|
|
#[const_trait]
|
|
|
|
pub trait A {
|
|
|
|
fn a() -> u32;
|
|
|
|
}
|
|
|
|
|
2023-04-16 06:12:37 -05:00
|
|
|
#[const_trait]
|
|
|
|
pub trait Spec {}
|
|
|
|
|
|
|
|
impl<T: ~const Spec> const A for T {
|
2022-09-24 15:15:19 -05:00
|
|
|
default fn a() -> u32 {
|
|
|
|
2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-16 06:12:37 -05:00
|
|
|
impl<T: Spec + Sup> A for T {
|
2022-11-06 01:07:06 -05:00
|
|
|
//~^ ERROR: cannot specialize
|
2023-07-29 03:20:25 -05:00
|
|
|
//FIXME(effects) ~| ERROR: missing `~const` qualifier
|
2022-09-24 15:15:19 -05:00
|
|
|
fn a() -> u32 {
|
|
|
|
3
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|