diff options
Diffstat (limited to 'src/test/ui/const-generics/const_trait_fn-issue-88433.rs')
-rw-r--r-- | src/test/ui/const-generics/const_trait_fn-issue-88433.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/const_trait_fn-issue-88433.rs b/src/test/ui/const-generics/const_trait_fn-issue-88433.rs new file mode 100644 index 000000000..8724fa698 --- /dev/null +++ b/src/test/ui/const-generics/const_trait_fn-issue-88433.rs @@ -0,0 +1,26 @@ +// build-pass + +#![feature(const_trait_impl)] + +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() {} |