//@ check-pass #![feature(generic_const_items, associated_const_equality, adt_const_params)] #![allow(incomplete_features)] trait Owner { const C: u32; const K: u32; const Q: Maybe; } impl Owner for () { const C: u32 = N; const K: u32 = N + 1; const Q: Maybe = Maybe::Nothing; } fn take0(_: impl Owner = { N }>) {} fn take1(_: impl Owner = 100>) {} fn take2(_: impl Owner = { Maybe::Just(()) }>) {} fn main() { take0::<128>(()); take1(()); } #[derive(PartialEq, Eq, std::marker::ConstParamTy)] enum Maybe { Nothing, Just(T), }