about summary refs log tree commit diff
path: root/src/test/ui/const-generics/issues/issue-61747.rs
blob: 3aa2e6a5c31dc8d996858861816f827e146a4128 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// revisions: full min
#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete

struct Const<const N: usize>;

impl<const C: usize> Const<{C}> {
    fn successor() -> Const<{C + 1}> {
        //[full]~^ ERROR constant expression depends on a generic parameter
        //[min]~^^ ERROR generic parameters may not be used
        Const
    }
}

fn main() {
    let _x: Const::<2> = Const::<1>::successor();
}