Make --json unused-extern deny/forbid level messages cause exit with error status

Closes: https://github.com/rust-lang/rust/issues/96068
This commit is contained in:
Jeremy Fitzhardinge 2022-04-15 00:37:40 -07:00 committed by Jeremy Fitzhardinge
parent 2373599b82
commit 39f2f18463
4 changed files with 10 additions and 4 deletions

View File

@ -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(

View File

@ -1,4 +1,4 @@
// Check for unused crate dep, no path
// Check for unused crate dep, json event, deny, expect compile failure
// edition:2018
// compile-flags: -Dunused-crate-dependencies -Zunstable-options --json unused-externs --error-format=json

View File

@ -1,4 +1,4 @@
// Check for unused crate dep, no path
// Check for unused crate dep, deny, expect failure
// edition:2018
// compile-flags: -Dunused-crate-dependencies

View File

@ -1,4 +1,4 @@
// Check for unused crate dep, no path
// Check for unused crate dep, warn, json event, expect pass
// edition:2018
// check-pass