summaryrefslogtreecommitdiffstats
path: root/src/test/ui/trait-impl-bound-suggestions.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/trait-impl-bound-suggestions.rs')
-rw-r--r--src/test/ui/trait-impl-bound-suggestions.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/trait-impl-bound-suggestions.rs b/src/test/ui/trait-impl-bound-suggestions.rs
new file mode 100644
index 000000000..bf7517517
--- /dev/null
+++ b/src/test/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() { }