mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 03:25:55 +00:00
32 lines
497 B
Rust
32 lines
497 B
Rust
#![feature(const_trait_impl, effects, 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
|
|
//FIXME(effects) ~| ERROR: missing `~const` qualifier
|
|
fn a() -> u32 {
|
|
3
|
|
}
|
|
}
|
|
|
|
fn main() {}
|