Skip to content

Commit 7bf52a3

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 6894f43 commit 7bf52a3

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
@@ -1295,20 +1295,16 @@ impl DiagCtxtInner {
12951295
return None;
12961296
}
12971297
Warning if !self.flags.can_emit_warnings => {
1298-
if diagnostic.has_future_breakage() {
1299-
(*TRACK_DIAGNOSTIC)(diagnostic, &mut |_| {});
1300-
}
13011298
return None;
13021299
}
13031300
Allow | Expect(_) => {
1304-
(*TRACK_DIAGNOSTIC)(diagnostic, &mut |_| {});
13051301
return None;
13061302
}
13071303
_ => {}
13081304
}
13091305

13101306
let mut guaranteed = None;
1311-
(*TRACK_DIAGNOSTIC)(diagnostic, &mut |mut diagnostic| {
1307+
TRACK_DIAGNOSTIC(diagnostic, &mut |mut diagnostic| {
13121308
if let Some(code) = diagnostic.code {
13131309
self.emitted_diagnostic_codes.insert(code);
13141310
}

0 commit comments

Comments
 (0)