summaryrefslogtreecommitdiffstats
path: root/src/test/ui/trait-impl-bound-suggestions.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/trait-impl-bound-suggestions.fixed')
-rw-r--r--src/test/ui/trait-impl-bound-suggestions.fixed20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/trait-impl-bound-suggestions.fixed b/src/test/ui/trait-impl-bound-suggestions.fixed
new file mode 100644
index 000000000..744e7bef0
--- /dev/null
+++ b/src/test/ui/trait-impl-bound-suggestions.fixed
@@ -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=()> where X: std::marker::Copy {
+ fn return_the_constrained_type(&self, x: X) -> ConstrainedStruct<X> {
+ //~^ ERROR the trait bound `X: Copy` is not satisfied
+ ConstrainedStruct { x }
+ }
+}
+
+pub fn main() { }