summaryrefslogtreecommitdiffstats
path: root/tests/ui/typeck/explain_clone_autoref.stderr
blob: 4539da4389b3b16c0fef5529cf66f74a71ccb6eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
error[E0308]: mismatched types
  --> $DIR/explain_clone_autoref.rs:9:5
   |
LL | fn clone_thing(nc: &NotClone) -> NotClone {
   |                                  -------- expected `NotClone` because of return type
LL |
LL |     nc.clone()
   |     ^^^^^^^^^^ expected `NotClone`, found `&NotClone`
   |
note: `NotClone` does not implement `Clone`, so `&NotClone` was cloned instead
  --> $DIR/explain_clone_autoref.rs:9:5
   |
LL |     nc.clone()
   |     ^^
help: consider annotating `NotClone` with `#[derive(Clone)]`
   |
LL | #[derive(Clone)]
   |

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.