We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 60de755 commit bdab02cCopy full SHA for bdab02c
compiler/rustc_middle/src/lint.rs
@@ -408,13 +408,10 @@ pub fn lint_level(
408
// 2. If the corresponding `rustc_errors::Level` is warning, then that can be affected by
409
// `-A warnings` or `--cap-lints=xxx` on the command line. In which case, the diagnostic
410
// will be emitted if `can_emit_warnings` is true.
411
- {
412
- use rustc_errors::Level as ELevel;
413
- if matches!(err_level, ELevel::ForceWarning(_) | ELevel::Error)
414
- || sess.dcx().can_emit_warnings()
415
416
- decorate(&mut err);
417
- }
+ let skip = err_level == rustc_errors::Level::Warning && !sess.dcx().can_emit_warnings();
+
+ if !skip {
+ decorate(&mut err);
418
}
419
420
explain_lint_level_source(lint, level, src, &mut err);
0 commit comments