summaryrefslogtreecommitdiffstats
path: root/tests/ui/typeck/explain_clone_autoref.rs
blob: 9279e4c3901db303674d35d8ea5f23d980296d3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
struct NotClone;

fn main() {
    clone_thing(&NotClone);
}

fn clone_thing(nc: &NotClone) -> NotClone {
    //~^ NOTE expected `NotClone` because of return type
    nc.clone()
    //~^ ERROR mismatched type
    //~| NOTE `NotClone` does not implement `Clone`, so `&NotClone` was cloned instead
    //~| NOTE expected struct `NotClone`, found `&NotClone`
}