Skip to content

Commit 091091b

Browse files
committed
Remove useless TRACK_DIAGNOSTIC calls.
There are two calls to `TRACK_DIAGNOSTIC` in `DiagCtxtInner::emit_diagnostic` for cases where we don't emit anything and the closure does nothing. The only effect these calls have is to add a diagnostic to `ImplicitCtxt::diagnostics`, which then gets added to `QuerySideEffects::diagnostics`, which eventually gets handled by `DepGraphData::emit_side_effects`, which calls `emit_diagnostic` on the diagnostic, and again `emit_diagnostic` doesn't emit anything. It's a big, complicate no-op. This commit removes it.
1 parent 0d53135 commit 091091b

File tree

1 file changed

+1
-5
lines changed
  • compiler/rustc_errors/src

1 file changed

+1
-5
lines changed

compiler/rustc_errors/src/lib.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1294,20 +1294,16 @@ impl DiagCtxtInner {
12941294
return None;
12951295
}
12961296
Warning if !self.flags.can_emit_warnings => {
1297-
if diagnostic.has_future_breakage() {
1298-
(*TRACK_DIAGNOSTIC)(diagnostic, &mut |_| {});
1299-
}
13001297
return None;
13011298
}
13021299
Allow | Expect(_) => {
1303-
(*TRACK_DIAGNOSTIC)(diagnostic, &mut |_| {});
13041300
return None;
13051301
}
13061302
_ => {}
13071303
}
13081304

13091305
let mut guaranteed = None;
1310-
(*TRACK_DIAGNOSTIC)(diagnostic, &mut |mut diagnostic| {
1306+
TRACK_DIAGNOSTIC(diagnostic, &mut |mut diagnostic| {
13111307
if let Some(code) = diagnostic.code {
13121308
self.emitted_diagnostic_codes.insert(code);
13131309
}

0 commit comments

Comments
 (0)