summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/issue-82566-2.rs
blob: 80c8034bd0adff49f2c8dc483b439d9a58a14525 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
struct Foo1<const N1: usize>;
struct Foo2<const N1: usize, const N2: usize>;
struct Foo3<const N1: usize, const N2: usize, const N3: usize>;

impl<const N1: usize> Foo1<N1> {
    const SUM: usize = N1;
}

impl<const N1: usize, const N2: usize> Foo2<N1, N2> {
    const SUM: usize = N1 + N2;
}

impl<const N1: usize, const N2: usize, const N3: usize> Foo3<N1, N2, N3> {
    const SUM: usize = N1 + N2 + N3;
}

fn foo1() -> [(); Foo1<10>::SUM] { //~ ERROR: comparison operators cannot be chained
    todo!()
}

fn foo2() -> [(); Foo2<10, 20>::SUM] {
    //~^ ERROR: expected one of `.`, `?`, `]`, or an operator, found `,`
    todo!()
}

fn foo3() -> [(); Foo3<10, 20, 30>::SUM] {
    //~^ ERROR: expected one of `.`, `?`, `]`, or an operator, found `,`
    todo!()
}

fn main() {}