]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.rs
1 // Tests that a const default trait impl can be specialized by another const
2 // trait impl and that the specializing impl will be used during const-eval.
6 #![feature(const_trait_impl)]
7 #![feature(min_specialization)]
14 const fn get_value
<T
: ~const Value
>() -> u32 {
18 impl<T
> const Value
for T
{
19 default fn value() -> u32 {
26 impl const Value
for FortyTwo
{
32 const ZERO
: u32 = get_value
::<()>();
34 const FORTY_TWO
: u32 = get_value
::<FortyTwo
>();
38 assert_eq
!(FORTY_TWO
, 42);