Skip to content

Commit aa1eeef

Browse files
committed
XXX: emit_diagnostic_without_consuming
1 parent e9fac72 commit aa1eeef

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_errors/src

1 file changed

+4
-0
lines changed

compiler/rustc_errors/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,7 @@ impl DiagCtxtInner {
13871387
&mut self,
13881388
diagnostic: &mut Diagnostic,
13891389
) -> Option<ErrorGuaranteed> {
1390+
// njn: Level::Error { .. } | Level::Fatal
13901391
if matches!(diagnostic.level, Level::Error { .. } | Level::Fatal) && self.treat_err_as_bug()
13911392
{
13921393
diagnostic.level = Level::Bug;
@@ -1396,11 +1397,13 @@ impl DiagCtxtInner {
13961397
// Diagnostics created before the definition of `HirId`s are unstable and can not yet
13971398
// be stored. Instead, they are buffered until the `LintExpectationId` is replaced by
13981399
// a stable one by the `LintLevelsBuilder`.
1400+
// njn: Level::Expect(id) | Level::Warning(Some(id)) => Some(*id),
13991401
if let Some(LintExpectationId::Unstable { .. }) = diagnostic.level.get_expectation_id() {
14001402
self.unstable_expect_diagnostics.push(diagnostic.clone());
14011403
return None;
14021404
}
14031405

1406+
// njn: Level::DelayedBug
14041407
if diagnostic.level == Level::DelayedBug {
14051408
// FIXME(eddyb) this should check for `has_errors` and stop pushing
14061409
// once *any* errors were emitted (and truncate `span_delayed_bugs`
@@ -1416,6 +1419,7 @@ impl DiagCtxtInner {
14161419
}
14171420
}
14181421

1422+
// njn: self.code... Error only?
14191423
if diagnostic.has_future_breakage() {
14201424
// Future breakages aren't emitted if they're Level::Allowed,
14211425
// but they still need to be constructed and stashed below,

0 commit comments

Comments
 (0)