]>
git.proxmox.com Git - rustc.git/blob - tests/ui/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.rs
1 // Tests that a non-const default impl can be specialized by a const trait impl,
2 // but that the default impl cannot be used in a const context.
6 #![feature(const_trait_impl)]
7 #![feature(min_specialization)]
14 const fn get_value
<T
: ~const Value
>() -> u32 {
19 default fn value() -> u32 {
20 println
!("You can't do that (constly)");
27 impl const Value
for FortyTwo
{
34 let zero
= get_value
::<()>();
37 const FORTY_TWO
: u32 = get_value
::<FortyTwo
>();
38 assert_eq
!(FORTY_TWO
, 42);