1
Fork 0

avoid many &str to String conversions with MultiSpan::push_span_label

This commit is contained in:
Takayuki Maeda 2022-06-29 21:16:43 +09:00
parent 0e1a6fb463
commit 6212e6b339
17 changed files with 38 additions and 66 deletions

View file

@ -2204,8 +2204,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
_ => true,
};
if !ident.span.overlaps(span) && !same_line {
multispan
.push_span_label(ident.span, "required by a bound in this".to_string());
multispan.push_span_label(ident.span, "required by a bound in this");
}
}
let descr = format!("required by a bound in `{}`", item_name);