about summary refs log tree commit diff
path: root/src/tools/rustfmt/tests/source/issue-811.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rustfmt/tests/source/issue-811.rs')
-rw-r--r--src/tools/rustfmt/tests/source/issue-811.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/source/issue-811.rs b/src/tools/rustfmt/tests/source/issue-811.rs
new file mode 100644
index 00000000000..b7a89b5d0f9
--- /dev/null
+++ b/src/tools/rustfmt/tests/source/issue-811.rs
@@ -0,0 +1,19 @@
+trait FooTrait<T>: Sized {
+    type Bar: BarTrait<T>;
+}
+
+trait BarTrait<T>: Sized {
+    type Baz;
+    fn foo();
+}
+
+type Foo<T: FooTrait> = <<T as FooTrait<U>>::Bar as BarTrait<U>>::Baz;
+type Bar<T: BarTrait> = <T as BarTrait<U>>::Baz;
+
+fn some_func<T: FooTrait<U>, U>() {
+    <<T as FooTrait<U>>::Bar as BarTrait<U>>::foo();
+}
+
+fn some_func<T: BarTrait<U>>() {
+    <T as BarTrait<U>>::foo();
+}