]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/issue-106443-sugg-clone-for-bound.stderr
Suggest possible clone when we have &T
[rust.git] / src / test / ui / suggestions / issue-106443-sugg-clone-for-bound.stderr
1 error[E0277]: the trait bound `&T: X` is not satisfied
2   --> $DIR/issue-106443-sugg-clone-for-bound.rs:10:9
3    |
4 LL |     foo(s);
5    |         ^ the trait `X` is not implemented for `&T`
6    |
7 help: consider further restricting this bound
8    |
9 LL | fn bar<T: X + Clone>(s: &T)  {
10    |             +++++++
11 help: consider using clone here
12    |
13 LL |     foo(s.clone());
14    |          ++++++++
15
16 error[E0277]: the trait bound `&T: X` is not satisfied
17   --> $DIR/issue-106443-sugg-clone-for-bound.rs:14:9
18    |
19 LL |     foo(s);
20    |         ^ the trait `X` is not implemented for `&T`
21    |
22 help: consider using clone here
23    |
24 LL |     foo(s.clone());
25    |          ++++++++
26
27 error: aborting due to 2 previous errors
28
29 For more information about this error, try `rustc --explain E0277`.