Gate the printing on --json=unused-externs
This commit is contained in:
parent
aef1e35edc
commit
3f2ca47a79
4 changed files with 22 additions and 6 deletions
|
@ -931,8 +931,9 @@ impl<'a> CrateLoader<'a> {
|
|||
diag,
|
||||
);
|
||||
}
|
||||
// FIXME: add gating
|
||||
self.sess.parse_sess.span_diagnostic.emit_unused_externs(&unused_externs);
|
||||
if self.sess.opts.json_unused_externs {
|
||||
self.sess.parse_sess.span_diagnostic.emit_unused_externs(&unused_externs);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn postprocess(&mut self, krate: &ast::Crate) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue