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