diff options
| author | Jeremy Fitzhardinge <jeremy@goop.org> | 2022-04-15 00:37:40 -0700 |
|---|---|---|
| committer | Jeremy Fitzhardinge <jsgf@fb.com> | 2022-04-27 10:04:25 -0700 |
| commit | 39f2f1846376c1522b2264069c94a19ef42ebb98 (patch) | |
| tree | 12f1ce0919b74b148020a8db55ed5915091baf7f /compiler/rustc_errors/src | |
| parent | 2373599b82c4723ee738fe0408142d6bfcbb980c (diff) | |
| download | rust-39f2f1846376c1522b2264069c94a19ef42ebb98.tar.gz rust-39f2f1846376c1522b2264069c94a19ef42ebb98.zip | |
Make --json unused-extern deny/forbid level messages cause exit with error status
Closes: https://github.com/rust-lang/rust/issues/96068
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 4e6ab0edf66..9f126d25a8d 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -970,7 +970,13 @@ impl Handler { } pub fn emit_unused_externs(&self, lint_level: &str, unused_externs: &[&str]) { - self.inner.borrow_mut().emit_unused_externs(lint_level, unused_externs) + let mut inner = self.inner.borrow_mut(); + + if lint_level == "deny" || lint_level == "forbid" { + inner.bump_err_count(); + } + + inner.emit_unused_externs(lint_level, unused_externs) } pub fn update_unstable_expectation_id( |
