diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-07-23 09:31:34 +0200 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2023-07-23 09:48:07 +0200 |
| commit | abde841f0abfced6be0a51d9de6d172f7b993081 (patch) | |
| tree | 8279715edd8a8b332ec4b1babce6728092198338 | |
| parent | cec34a43b1b14f4e39363f3b283d7ac4f593ee81 (diff) | |
| download | rust-abde841f0abfced6be0a51d9de6d172f7b993081.tar.gz rust-abde841f0abfced6be0a51d9de6d172f7b993081.zip | |
remove redundant clones
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/errors.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_metadata/src/fs.rs | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_ssa/src/errors.rs b/compiler/rustc_codegen_ssa/src/errors.rs index c72d37be748..dbe1d6e8ba8 100644 --- a/compiler/rustc_codegen_ssa/src/errors.rs +++ b/compiler/rustc_codegen_ssa/src/errors.rs @@ -353,7 +353,7 @@ impl IntoDiagnostic<'_> for LinkingFailed<'_> { let contains_undefined_ref = self.escaped_output.contains("undefined reference to"); - diag.note(format!("{:?}", self.command)).note(self.escaped_output.to_string()); + diag.note(format!("{:?}", self.command)).note(self.escaped_output); // Trying to match an error from OS linkers // which by now we have no way to translate. diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs index 94f64a1ffdb..fa1056e724a 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs @@ -1069,7 +1069,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } else if let ExprKind::MethodCall(..) = rcvr.kind { err.span_note( sp, - modifies_rcvr_note.clone() + ", it is not meant to be used in method chains.", + modifies_rcvr_note + ", it is not meant to be used in method chains.", ); } else { err.span_note(sp, modifies_rcvr_note); diff --git a/compiler/rustc_metadata/src/fs.rs b/compiler/rustc_metadata/src/fs.rs index 238f963ed46..69a77e82f98 100644 --- a/compiler/rustc_metadata/src/fs.rs +++ b/compiler/rustc_metadata/src/fs.rs @@ -104,8 +104,8 @@ pub fn encode_and_write_metadata(tcx: TyCtxt<'_>) -> (EncodedMetadata, bool) { }; // Load metadata back to memory: codegen may need to include it in object files. - let metadata = EncodedMetadata::from_path(metadata_filename.clone(), metadata_tmpdir) - .unwrap_or_else(|err| { + let metadata = + EncodedMetadata::from_path(metadata_filename, metadata_tmpdir).unwrap_or_else(|err| { tcx.sess.emit_fatal(FailedCreateEncodedMetadata { err }); }); |
