Skip to content

Commit 699f4a6

Browse files
committed
Auto merge of #113972 - matthiaskrgr:clones_123, r=cjgillot
remove redundant clones
2 parents 2a4a8c8 + abde841 commit 699f4a6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

compiler/rustc_codegen_ssa/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ impl IntoDiagnostic<'_> for LinkingFailed<'_> {
353353

354354
let contains_undefined_ref = self.escaped_output.contains("undefined reference to");
355355

356-
diag.note(format!("{:?}", self.command)).note(self.escaped_output.to_string());
356+
diag.note(format!("{:?}", self.command)).note(self.escaped_output);
357357

358358
// Trying to match an error from OS linkers
359359
// which by now we have no way to translate.

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10691069
} else if let ExprKind::MethodCall(..) = rcvr.kind {
10701070
err.span_note(
10711071
sp,
1072-
modifies_rcvr_note.clone() + ", it is not meant to be used in method chains.",
1072+
modifies_rcvr_note + ", it is not meant to be used in method chains.",
10731073
);
10741074
} else {
10751075
err.span_note(sp, modifies_rcvr_note);

compiler/rustc_metadata/src/fs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ pub fn encode_and_write_metadata(tcx: TyCtxt<'_>) -> (EncodedMetadata, bool) {
104104
};
105105

106106
// Load metadata back to memory: codegen may need to include it in object files.
107-
let metadata = EncodedMetadata::from_path(metadata_filename.clone(), metadata_tmpdir)
108-
.unwrap_or_else(|err| {
107+
let metadata =
108+
EncodedMetadata::from_path(metadata_filename, metadata_tmpdir).unwrap_or_else(|err| {
109109
tcx.sess.emit_fatal(FailedCreateEncodedMetadata { err });
110110
});
111111

0 commit comments

Comments
 (0)