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.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/trait-impl-bound-suggestions.rs b/tests/ui/trait-impl-bound-suggestions.rs
new file mode 100644
index 00000000000..bf75175179e
--- /dev/null
+++ b/tests/ui/trait-impl-bound-suggestions.rs
@@ -0,0 +1,20 @@
+// run-rustfix
+
+#[allow(unused)]
+use std::fmt::Debug;
+// Rustfix should add this, or use `std::fmt::Debug` instead.
+
+#[allow(dead_code)]
+struct ConstrainedStruct<X: Copy> {
+    x: X
+}
+
+#[allow(dead_code)]
+trait InsufficientlyConstrainedGeneric<X=()> {
+    fn return_the_constrained_type(&self, x: X) -> ConstrainedStruct<X> {
+        //~^ ERROR the trait bound `X: Copy` is not satisfied
+        ConstrainedStruct { x }
+    }
+}
+
+pub fn main() { }