about summary refs log tree commit diff
path: root/tests/ui/traits/default-method/bound-subst.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/traits/default-method/bound-subst.rs')
-rw-r--r--tests/ui/traits/default-method/bound-subst.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/traits/default-method/bound-subst.rs b/tests/ui/traits/default-method/bound-subst.rs
new file mode 100644
index 00000000000..6a5d5c8ba2d
--- /dev/null
+++ b/tests/ui/traits/default-method/bound-subst.rs
@@ -0,0 +1,18 @@
+// run-pass
+
+
+trait A<T> {
+    fn g<U>(&self, x: T, y: U) -> (T, U) { (x, y) }
+}
+
+impl A<i32> for i32 { }
+impl<T> A<T> for u32 { }
+
+fn f<T, U, V: A<T>>(i: V, j: T, k: U) -> (T, U) {
+    i.g(j, k)
+}
+
+pub fn main () {
+    assert_eq!(f(0, 1, 2), (1, 2));
+    assert_eq!(f(0, 1, 2), (1, 2));
+}