rust/tests/ui/suggestions/clone-on-unconstrained-borr...

17 lines
211 B
Rust

//@ 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);
}