summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.fixed')
-rw-r--r--tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.fixed16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.fixed b/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.fixed
new file mode 100644
index 000000000..4f9e93a47
--- /dev/null
+++ b/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.fixed
@@ -0,0 +1,16 @@
+// run-rustfix
+fn wat<T: Clone>(t: &T) -> T {
+ t.clone() //~ ERROR E0308
+}
+
+#[derive(Clone)]
+struct Foo;
+
+fn wut(t: &Foo) -> Foo {
+ t.clone() //~ ERROR E0308
+}
+
+fn main() {
+ wat(&42);
+ wut(&Foo);
+}