mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
29 lines
445 B
Rust
29 lines
445 B
Rust
#![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;
|
|
}
|
|
|
|
impl<T: ~const Default> const A for T {
|
|
default fn a() -> u32 {
|
|
2
|
|
}
|
|
}
|
|
|
|
impl<T: Default + Sup> A for T {
|
|
//~^ ERROR: cannot specialize
|
|
//~| ERROR: missing `~const` qualifier
|
|
fn a() -> u32 {
|
|
3
|
|
}
|
|
}
|
|
|
|
fn main() {}
|