diff options
| author | Takayuki Maeda <takoyaki0316@gmail.com> | 2022-06-29 21:16:43 +0900 |
|---|---|---|
| committer | Takayuki Maeda <takoyaki0316@gmail.com> | 2022-06-29 21:16:43 +0900 |
| commit | 6212e6b3396d8aeb5ab35f12caaf6eceea9b8836 (patch) | |
| tree | 194ee3233a5c4f575cd8b8fd00ce4844c7df589b /compiler/rustc_passes/src | |
| parent | 0e1a6fb463e7075572cee841525bf44a864da807 (diff) | |
| download | rust-6212e6b3396d8aeb5ab35f12caaf6eceea9b8836.tar.gz rust-6212e6b3396d8aeb5ab35f12caaf6eceea9b8836.zip | |
avoid many `&str` to `String` conversions with `MultiSpan::push_span_label`
Diffstat (limited to 'compiler/rustc_passes/src')
| -rw-r--r-- | compiler/rustc_passes/src/check_attr.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index 536d45b2399..40545b19b24 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -857,11 +857,8 @@ impl CheckAttrVisitor<'_> { if let Some((prev_inline, prev_span)) = *specified_inline { if do_inline != prev_inline { let mut spans = MultiSpan::from_spans(vec![prev_span, meta.span()]); - spans.push_span_label(prev_span, String::from("this attribute...")); - spans.push_span_label( - meta.span(), - String::from("...conflicts with this attribute"), - ); + spans.push_span_label(prev_span, "this attribute..."); + spans.push_span_label(meta.span(), "...conflicts with this attribute"); self.tcx .sess .struct_span_err(spans, "conflicting doc inlining attributes") |
