File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
compiler/rustc_middle/src Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -408,13 +408,10 @@ pub fn lint_level(
408
408
// 2. If the corresponding `rustc_errors::Level` is warning, then that can be affected by
409
409
// `-A warnings` or `--cap-lints=xxx` on the command line. In which case, the diagnostic
410
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
- }
411
+ let skip = err_level == rustc_errors:: Level :: Warning && !sess. dcx ( ) . can_emit_warnings ( ) ;
412
+
413
+ if !skip {
414
+ decorate ( & mut err) ;
418
415
}
419
416
420
417
explain_lint_level_source ( lint, level, src, & mut err) ;
You can’t perform that action at this time.
0 commit comments