Rollup merge of #105715 - estebank:unsatisfied-bounds-label, r=compiler-errors
Do not mention long types in E0599 label The type is already mentioned in the main message and the list of unmet bounds.
This commit is contained in:
commit
cb9bcafe0d
@ -893,7 +893,14 @@ trait bound{s}",
|
||||
}
|
||||
}
|
||||
} else {
|
||||
err.span_label(span, format!("{item_kind} cannot be called on `{ty_str}` due to unsatisfied trait bounds"));
|
||||
let ty_str = if ty_str.len() > 50 {
|
||||
String::new()
|
||||
} else {
|
||||
format!("on `{ty_str}` ")
|
||||
};
|
||||
err.span_label(span, format!(
|
||||
"{item_kind} cannot be called {ty_str}due to unsatisfied trait bounds"
|
||||
));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -8,7 +8,7 @@ LL | pub struct Map<S, F> {
|
||||
| doesn't satisfy `_: StreamExt`
|
||||
...
|
||||
LL | let filter = map.filterx(|x: &_| true);
|
||||
| ^^^^^^^ method cannot be called on `Map<Repeat, [closure@$DIR/issue-30786.rs:117:27: 117:34]>` due to unsatisfied trait bounds
|
||||
| ^^^^^^^ method cannot be called due to unsatisfied trait bounds
|
||||
|
|
||||
note: the following trait bounds were not satisfied:
|
||||
`&'a mut &Map<Repeat, [closure@$DIR/issue-30786.rs:117:27: 117:34]>: Stream`
|
||||
@ -29,7 +29,7 @@ LL | pub struct Filter<S, F> {
|
||||
| doesn't satisfy `_: StreamExt`
|
||||
...
|
||||
LL | let count = filter.countx();
|
||||
| ^^^^^^ method cannot be called on `Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>` due to unsatisfied trait bounds
|
||||
| ^^^^^^ method cannot be called due to unsatisfied trait bounds
|
||||
|
|
||||
note: the following trait bounds were not satisfied:
|
||||
`&'a mut &Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>: Stream`
|
||||
|
@ -13,7 +13,7 @@ error[E0599]: the method `collect` exists for struct `Cloned<TakeWhile<&mut std:
|
||||
--> $DIR/issue-31173.rs:12:10
|
||||
|
|
||||
LL | .collect();
|
||||
| ^^^^^^^ method cannot be called on `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:7:21: 7:25]>>` due to unsatisfied trait bounds
|
||||
| ^^^^^^^ method cannot be called due to unsatisfied trait bounds
|
||||
--> $SRC_DIR/core/src/iter/adapters/take_while.rs:LL:COL
|
||||
|
|
||||
= note: doesn't satisfy `<_ as Iterator>::Item = &_`
|
||||
|
@ -17,7 +17,7 @@ error[E0599]: the method `count` exists for struct `Filter<Fuse<std::iter::Once<
|
||||
--> $DIR/issue-36053-2.rs:7:55
|
||||
|
|
||||
LL | once::<&str>("str").fuse().filter(|a: &str| true).count();
|
||||
| --------- ^^^^^ method cannot be called on `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>` due to unsatisfied trait bounds
|
||||
| --------- ^^^^^ method cannot be called due to unsatisfied trait bounds
|
||||
| |
|
||||
| doesn't satisfy `<_ as FnOnce<(&&str,)>>::Output = bool`
|
||||
| doesn't satisfy `_: FnMut<(&&str,)>`
|
||||
|
Loading…
Reference in New Issue
Block a user