]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/issue-106443-sugg-clone-for-bound.rs
Rollup merge of #106625 - Swatinem:ref/cov6, r=nagisa
[rust.git] / tests / ui / suggestions / issue-106443-sugg-clone-for-bound.rs
1 #[derive(Clone)]
2 struct S;
3
4 trait X {}
5
6 impl X for S {}
7
8 fn foo<T: X>(_: T) {}
9 fn bar<T: X>(s: &T) {
10     foo(s); //~ ERROR the trait bound `&T: X` is not satisfied
11 }
12
13 fn bar_with_clone<T: X + Clone>(s: &T) {
14     foo(s); //~ ERROR the trait bound `&T: X` is not satisfied
15 }
16
17 fn main() {
18     let s = &S;
19     bar(s);
20 }