On long E0277 primary span label, move it to a help
Long span labels don't read well.
This commit is contained in:
parent
092ecca5b9
commit
1a0c502183
15 changed files with 93 additions and 78 deletions
|
@ -328,6 +328,11 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
|
|||
}
|
||||
} else if let Some(custom_explanation) = safe_transmute_explanation {
|
||||
err.span_label(span, custom_explanation);
|
||||
} else if explanation.len() > self.tcx.sess.diagnostic_width() {
|
||||
// Really long types don't look good as span labels, instead move it
|
||||
// to a `help`.
|
||||
err.span_label(span, "unsatisfied trait bound");
|
||||
err.help(explanation);
|
||||
} else {
|
||||
err.span_label(span, explanation);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue