]> git.lizzy.rs Git - rust.git/blob - src/test/ui/typeck/explain_clone_autoref.rs
Auto merge of #100578 - Urgau:float-next-up-down, r=scottmcm
[rust.git] / src / test / ui / typeck / explain_clone_autoref.rs
1 struct NotClone;
2
3 fn main() {
4     clone_thing(&NotClone);
5 }
6
7 fn clone_thing(nc: &NotClone) -> NotClone {
8     //~^ NOTE expected `NotClone` because of return type
9     nc.clone()
10     //~^ ERROR mismatched type
11     //~| NOTE `NotClone` does not implement `Clone`, so `&NotClone` was cloned instead
12     //~| NOTE expected struct `NotClone`, found `&NotClone`
13 }