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

struct Foo;

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

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