about summary refs log tree commit diff
path: root/tests/ui/suggestions/as-ref-2.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/suggestions/as-ref-2.stderr')
-rw-r--r--tests/ui/suggestions/as-ref-2.stderr9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/suggestions/as-ref-2.stderr b/tests/ui/suggestions/as-ref-2.stderr
index 5432fcb1a58..30928577537 100644
--- a/tests/ui/suggestions/as-ref-2.stderr
+++ b/tests/ui/suggestions/as-ref-2.stderr
@@ -12,6 +12,15 @@ LL |     let _y = foo;
    |
 note: `Option::<T>::map` takes ownership of the receiver `self`, which moves `foo`
   --> $SRC_DIR/core/src/option.rs:LL:COL
+help: you could `clone` the value and consume it, if the `Struct: Clone` trait bound could be satisfied
+   |
+LL |     let _x: Option<Struct> = foo.clone().map(|s| bar(&s));
+   |                                 ++++++++
+help: consider annotating `Struct` with `#[derive(Clone)]`
+   |
+LL + #[derive(Clone)]
+LL | struct Struct;
+   |
 
 error: aborting due to 1 previous error