]> git.lizzy.rs Git - rust.git/blob - tests/ui/typeck/explain_clone_autoref.rs
Rollup merge of #106714 - Ezrashaw:remove-e0490, r=davidtwco
[rust.git] / tests / 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 }