about summary refs log tree commit diff
path: root/tests/ui/associated-consts/associated-const-trait-bound.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/associated-consts/associated-const-trait-bound.rs')
-rw-r--r--tests/ui/associated-consts/associated-const-trait-bound.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/associated-consts/associated-const-trait-bound.rs b/tests/ui/associated-consts/associated-const-trait-bound.rs
new file mode 100644
index 00000000000..403cdbd7ff3
--- /dev/null
+++ b/tests/ui/associated-consts/associated-const-trait-bound.rs
@@ -0,0 +1,21 @@
+// build-pass (FIXME(62277): could be check-pass?)
+
+trait ConstDefault {
+    const DEFAULT: Self;
+}
+
+trait Foo: Sized {}
+
+trait FooExt: Foo {
+    type T: ConstDefault;
+}
+
+trait Bar<F: FooExt> {
+    const T: F::T;
+}
+
+impl<F: FooExt> Bar<F> for () {
+    const T: F::T = <F::T as ConstDefault>::DEFAULT;
+}
+
+fn main() {}