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:
parent
ba64ba8b0d
commit
2a0d7126e7
4 changed files with 12 additions and 5 deletions
|
@ -895,7 +895,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
} 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"
|
||||
));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue