You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When encountering a missing bound that involves a type parameter, on associated functions we look at the generics to see if the type parameter is present. If so, we suggest the bound on the associated function instead of on the impl/trait. At the impl/trait doesn't have another type parameter of that name, then we don't suggest the bound at that item level.
```
error[E0277]: the trait bound `B: From<T>` is not satisfied
--> $DIR/suggest-restriction-involving-type-param.rs:20:33
|
LL | B { x: v.iter().map(|e| B::from(e.clone()).x).collect::<Vec<String>>().join(" ") }
| ^ the trait `From<T>` is not implemented for `B`
|
help: consider further restricting the type
|
LL | pub fn from_many<T: Into<B> + Clone>(v: Vec<T>) -> Self where B: From<T> {
| ++++++++++++++++
```
Fixrust-lang#104089.
0 commit comments