]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.fixed
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / suggestions / clone-on-unconstrained-borrowed-type-param.fixed
1 // run-rustfix
2 fn wat<T: Clone>(t: &T) -> T {
3     t.clone() //~ ERROR E0308
4 }
5
6 #[derive(Clone)]
7 struct Foo;
8
9 fn wut(t: &Foo) -> Foo {
10     t.clone() //~ ERROR E0308
11 }
12
13 fn main() {
14     wat(&42);
15     wut(&Foo);
16 }