rust/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.rs

32 lines
523 B
Rust
Raw Normal View History

2022-09-24 15:15:19 -05:00
#![feature(const_trait_impl, min_specialization, rustc_attrs)]
2023-07-27 10:51:02 -05:00
// known-bug: #110395
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;
}
impl<T: Default> A for T {
default fn a() -> u32 {
2
}
}
impl<T: Default + ~const Sup> const A for T {
fn a() -> u32 {
3
}
}
const fn generic<T: Default>() {
<T as A>::a();
2023-07-27 10:51:02 -05:00
//FIXME ~^ ERROR: the trait bound `T: ~const Sup` is not satisfied
2022-09-24 15:15:19 -05:00
}
fn main() {}