2023-01-03 05:27:49 +00:00
|
|
|
error[E0277]: the trait bound `&T: X` is not satisfied
|
|
|
|
--> $DIR/issue-106443-sugg-clone-for-bound.rs:10:9
|
|
|
|
|
|
|
|
|
LL | foo(s);
|
|
|
|
| ^ the trait `X` is not implemented for `&T`
|
|
|
|
|
|
|
|
|
help: consider further restricting this bound
|
|
|
|
|
|
2023-01-08 14:51:42 +00:00
|
|
|
LL | fn bar<T: X + Clone>(s: &T) {
|
2023-01-03 05:27:49 +00:00
|
|
|
| +++++++
|
|
|
|
help: consider using clone here
|
|
|
|
|
|
|
|
|
LL | foo(s.clone());
|
|
|
|
| ++++++++
|
|
|
|
|
|
|
|
error[E0277]: the trait bound `&T: X` is not satisfied
|
|
|
|
--> $DIR/issue-106443-sugg-clone-for-bound.rs:14:9
|
|
|
|
|
|
|
|
|
LL | foo(s);
|
|
|
|
| ^ the trait `X` is not implemented for `&T`
|
|
|
|
|
|
|
|
|
help: consider using clone here
|
|
|
|
|
|
|
|
|
LL | foo(s.clone());
|
|
|
|
| ++++++++
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|