mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Remove some unnecessary clone
calls.
This commit is contained in:
parent
8ba25d0989
commit
df322fc29f
@ -1817,7 +1817,7 @@ impl Emitter for SharedEmitter {
|
|||||||
drop(self.sender.send(SharedEmitterMessage::Diagnostic(Diagnostic {
|
drop(self.sender.send(SharedEmitterMessage::Diagnostic(Diagnostic {
|
||||||
msgs: diag.messages.clone(),
|
msgs: diag.messages.clone(),
|
||||||
args: args.clone(),
|
args: args.clone(),
|
||||||
code: diag.code.clone(),
|
code: diag.code,
|
||||||
lvl: diag.level(),
|
lvl: diag.level(),
|
||||||
})));
|
})));
|
||||||
for child in &diag.children {
|
for child in &diag.children {
|
||||||
|
@ -1252,7 +1252,7 @@ impl DiagCtxtInner {
|
|||||||
// be stored. Instead, they are buffered until the `LintExpectationId` is replaced by
|
// be stored. Instead, they are buffered until the `LintExpectationId` is replaced by
|
||||||
// a stable one by the `LintLevelsBuilder`.
|
// a stable one by the `LintLevelsBuilder`.
|
||||||
if let Some(LintExpectationId::Unstable { .. }) = diagnostic.level.get_expectation_id() {
|
if let Some(LintExpectationId::Unstable { .. }) = diagnostic.level.get_expectation_id() {
|
||||||
self.unstable_expect_diagnostics.push(diagnostic.clone());
|
self.unstable_expect_diagnostics.push(diagnostic);
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1267,16 +1267,14 @@ impl DiagCtxtInner {
|
|||||||
DelayedBug(DelayedBugKind::Normal) => {
|
DelayedBug(DelayedBugKind::Normal) => {
|
||||||
let backtrace = std::backtrace::Backtrace::capture();
|
let backtrace = std::backtrace::Backtrace::capture();
|
||||||
self.span_delayed_bugs
|
self.span_delayed_bugs
|
||||||
.push(DelayedDiagnostic::with_backtrace(diagnostic.clone(), backtrace));
|
.push(DelayedDiagnostic::with_backtrace(diagnostic, backtrace));
|
||||||
|
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
return Some(ErrorGuaranteed::unchecked_claim_error_was_emitted());
|
return Some(ErrorGuaranteed::unchecked_claim_error_was_emitted());
|
||||||
}
|
}
|
||||||
DelayedBug(DelayedBugKind::GoodPath) => {
|
DelayedBug(DelayedBugKind::GoodPath) => {
|
||||||
let backtrace = std::backtrace::Backtrace::capture();
|
let backtrace = std::backtrace::Backtrace::capture();
|
||||||
self.good_path_delayed_bugs
|
self.good_path_delayed_bugs
|
||||||
.push(DelayedDiagnostic::with_backtrace(diagnostic.clone(), backtrace));
|
.push(DelayedDiagnostic::with_backtrace(diagnostic, backtrace));
|
||||||
|
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
|
Loading…
Reference in New Issue
Block a user