]> git.lizzy.rs Git - rust.git/blob - src/test/ui/typeck/explain_clone_autoref.stderr
Rollup merge of #105694 - ouz-a:issue_105689, r=estebank
[rust.git] / src / test / ui / typeck / explain_clone_autoref.stderr
1 error[E0308]: mismatched types
2   --> $DIR/explain_clone_autoref.rs:9:5
3    |
4 LL | fn clone_thing(nc: &NotClone) -> NotClone {
5    |                                  -------- expected `NotClone` because of return type
6 LL |
7 LL |     nc.clone()
8    |     ^^^^^^^^^^ expected struct `NotClone`, found `&NotClone`
9    |
10 note: `NotClone` does not implement `Clone`, so `&NotClone` was cloned instead
11   --> $DIR/explain_clone_autoref.rs:9:5
12    |
13 LL |     nc.clone()
14    |     ^^
15 help: consider annotating `NotClone` with `#[derive(Clone)]`
16    |
17 LL | #[derive(Clone)]
18    |
19
20 error: aborting due to previous error
21
22 For more information about this error, try `rustc --explain E0308`.