rust/tests/ui/const-generics/defaults/auxiliary/const_defaulty.rs

12 lines
199 B
Rust
Raw Normal View History

2021-03-03 00:38:02 -06:00
pub struct Defaulted<const N: usize=3>;
impl Defaulted {
pub fn new() -> Self {
Defaulted
}
}
impl<const N: usize> Defaulted<N> {
pub fn value(&self) -> usize {
N
}
}