summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/const_trait_fn-issue-88433.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/const-generics/const_trait_fn-issue-88433.rs')
-rw-r--r--tests/ui/const-generics/const_trait_fn-issue-88433.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/ui/const-generics/const_trait_fn-issue-88433.rs b/tests/ui/const-generics/const_trait_fn-issue-88433.rs
new file mode 100644
index 000000000..6e04cfaec
--- /dev/null
+++ b/tests/ui/const-generics/const_trait_fn-issue-88433.rs
@@ -0,0 +1,27 @@
+// build-pass
+
+#![feature(const_trait_impl)]
+
+#[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() {}