summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/const_trait_fn-issue-88433.rs
blob: 88dff919206745ae2623dd4d70875e80d329a6ca (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
// build-pass

#![feature(const_trait_impl, effects)]

#[const_trait]
trait Func<T> {
    type Output;

    fn call_once(self, arg: T) -> Self::Output;
}


struct Closure;

impl const Func<&usize> for Closure {
    type Output = usize;

    fn call_once(self, arg: &usize) -> Self::Output {
        *arg
    }
}

enum Bug<T = [(); Closure.call_once(&0) ]> {
    V(T),
}

fn main() {}