about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/type-check-defaults.rs6
-rw-r--r--src/test/ui/type-check-defaults.stderr20
2 files changed, 25 insertions, 1 deletions
diff --git a/src/test/ui/type-check-defaults.rs b/src/test/ui/type-check-defaults.rs
index 2264fb860f1..a6e475eb1a3 100644
--- a/src/test/ui/type-check-defaults.rs
+++ b/src/test/ui/type-check-defaults.rs
@@ -29,4 +29,10 @@ trait SelfBound<T:Copy=Self> {}
 
 trait FooTrait<T:Iterator = IntoIter<i32>> where T::Item : Add<u8> {}
 
+trait Trait {}
+struct TwoParams<T, U>(T, U);
+impl Trait for TwoParams<i32, i32> {}
+// Check that each default is substituted individually in the clauses.
+struct Bogus<T = i32, U = i32>(TwoParams<T, U>) where TwoParams<T, U>: Trait;
+
 fn main() { }
diff --git a/src/test/ui/type-check-defaults.stderr b/src/test/ui/type-check-defaults.stderr
index 2a9f4eb693c..cf11282f7d2 100644
--- a/src/test/ui/type-check-defaults.stderr
+++ b/src/test/ui/type-check-defaults.stderr
@@ -67,5 +67,23 @@ error[E0277]: the trait bound `i32: std::ops::Add<u8>` is not satisfied
    = help: the trait `std::ops::Add<u8>` is not implemented for `i32`
    = note: required by `std::ops::Add`
 
-error: aborting due to 8 previous errors
+error[E0277]: the trait bound `TwoParams<i32, U>: Trait` is not satisfied
+  --> $DIR/type-check-defaults.rs:36:1
+   |
+36 | struct Bogus<T = i32, U = i32>(TwoParams<T, U>) where TwoParams<T, U>: Trait;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `TwoParams<i32, U>`
+   |
+   = help: consider adding a `where TwoParams<i32, U>: Trait` bound
+   = note: required by `Trait`
+
+error[E0277]: the trait bound `TwoParams<T, i32>: Trait` is not satisfied
+  --> $DIR/type-check-defaults.rs:36:1
+   |
+36 | struct Bogus<T = i32, U = i32>(TwoParams<T, U>) where TwoParams<T, U>: Trait;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `TwoParams<T, i32>`
+   |
+   = help: consider adding a `where TwoParams<T, i32>: Trait` bound
+   = note: required by `Trait`
+
+error: aborting due to 10 previous errors