summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/self_normalization2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/self_normalization2.rs')
-rw-r--r--tests/ui/consts/self_normalization2.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/consts/self_normalization2.rs b/tests/ui/consts/self_normalization2.rs
new file mode 100644
index 000000000..4fca38cba
--- /dev/null
+++ b/tests/ui/consts/self_normalization2.rs
@@ -0,0 +1,21 @@
+// check-pass
+
+trait Gen<T> {
+ fn gen(x: Self) -> T;
+}
+
+struct A;
+
+impl Gen<[(); 0]> for A {
+ fn gen(x: Self) -> [(); 0] {
+ []
+ }
+}
+
+fn array() -> impl Gen<[(); 0]> {
+ A
+}
+
+fn main() {
+ let [] = Gen::gen(array());
+}