about summary refs log tree commit diff
path: root/tests/ui/trait-impl-bound-suggestions.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/trait-impl-bound-suggestions.rs')
-rw-r--r--tests/ui/trait-impl-bound-suggestions.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/ui/trait-impl-bound-suggestions.rs b/tests/ui/trait-impl-bound-suggestions.rs
index 46130a5e766..9a494402260 100644
--- a/tests/ui/trait-impl-bound-suggestions.rs
+++ b/tests/ui/trait-impl-bound-suggestions.rs
@@ -10,19 +10,21 @@ struct ConstrainedStruct<X: Copy> {
 }
 
 #[allow(dead_code)]
-trait InsufficientlyConstrainedGeneric<X=()> {
+trait InsufficientlyConstrainedGeneric<X=()> where Self: Sized {
     fn return_the_constrained_type(&self, x: X) -> ConstrainedStruct<X> {
         //~^ ERROR the trait bound `X: Copy` is not satisfied
         ConstrainedStruct { x }
+        //~^ ERROR the trait bound `X: Copy` is not satisfied
     }
 }
 
 // Regression test for #120838
 #[allow(dead_code)]
-trait InsufficientlyConstrainedGenericWithEmptyWhere<X=()> where {
+trait InsufficientlyConstrainedGenericWithEmptyWhere<X=()> where Self: Sized {
     fn return_the_constrained_type(&self, x: X) -> ConstrainedStruct<X> {
         //~^ ERROR the trait bound `X: Copy` is not satisfied
         ConstrainedStruct { x }
+        //~^ ERROR the trait bound `X: Copy` is not satisfied
     }
 }