summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.fixed
blob: 4f9e93a47ed1c6bf88bcf5147cf0bff0b48f7322 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// run-rustfix
fn wat<T: Clone>(t: &T) -> T {
    t.clone() //~ ERROR E0308
}

#[derive(Clone)]
struct Foo;

fn wut(t: &Foo) -> Foo {
    t.clone() //~ ERROR E0308
}

fn main() {
    wat(&42);
    wut(&Foo);
}