about summary refs log tree commit diff
path: root/src/librustc_errors
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-01-22 16:30:15 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2020-01-27 01:18:18 +0100
commitec61761e465a61869d13e89274afa02257aba6d7 (patch)
tree2391a0566e8bc84cb39dd5267edd35d56aac1b15 /src/librustc_errors
parenta237641c7df8125b89b8f9c2a3594964ba8188f8 (diff)
don't clone types that are copy, round two.
Diffstat (limited to 'src/librustc_errors')
-rw-r--r--src/librustc_errors/emitter.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs
index f9e23e96fa8..bf660d188b2 100644
--- a/src/librustc_errors/emitter.rs
+++ b/src/librustc_errors/emitter.rs
@@ -400,7 +400,7 @@ pub trait Emitter {
             }
             if sm.span_to_filename(sp_label.span.clone()).is_macros() && !always_backtrace {
                 if let Some(use_site) = sp_label.span.macro_backtrace().last() {
-                    before_after.push((sp_label.span.clone(), use_site.call_site.clone()));
+                    before_after.push((sp_label.span, use_site.call_site));
                 }
             }
         }
@@ -1184,13 +1184,13 @@ impl EmitterWriter {
             let level_str = level.to_string();
             // The failure note level itself does not provide any useful diagnostic information
             if *level != Level::FailureNote && !level_str.is_empty() {
-                buffer.append(0, &level_str, Style::Level(level.clone()));
+                buffer.append(0, &level_str, Style::Level(*level));
             }
             // only render error codes, not lint codes
             if let Some(DiagnosticId::Error(ref code)) = *code {
-                buffer.append(0, "[", Style::Level(level.clone()));
-                buffer.append(0, &code, Style::Level(level.clone()));
-                buffer.append(0, "]", Style::Level(level.clone()));
+                buffer.append(0, "[", Style::Level(*level));
+                buffer.append(0, &code, Style::Level(*level));
+                buffer.append(0, "]", Style::Level(*level));
             }
             if *level != Level::FailureNote && !level_str.is_empty() {
                 buffer.append(0, ": ", header_style);
@@ -1495,7 +1495,7 @@ impl EmitterWriter {
         // Render the suggestion message
         let level_str = level.to_string();
         if !level_str.is_empty() {
-            buffer.append(0, &level_str, Style::Level(level.clone()));
+            buffer.append(0, &level_str, Style::Level(*level));
             buffer.append(0, ": ", Style::HeaderMsg);
         }
         self.msg_to_buffer(