]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/const_trait_fn-issue-88433.rs
Rollup merge of #106692 - eggyal:mv-binary_heap.rs-binary_heap/mod.rs, r=Mark-Simulacrum
[rust.git] / tests / ui / const-generics / const_trait_fn-issue-88433.rs
1 // build-pass
2
3 #![feature(const_trait_impl)]
4
5 #[const_trait]
6 trait Func<T> {
7     type Output;
8
9     fn call_once(self, arg: T) -> Self::Output;
10 }
11
12
13 struct Closure;
14
15 impl const Func<&usize> for Closure {
16     type Output = usize;
17
18     fn call_once(self, arg: &usize) -> Self::Output {
19         *arg
20     }
21 }
22
23 enum Bug<T = [(); Closure.call_once(&0) ]> {
24     V(T),
25 }
26
27 fn main() {}