Skip to content

Commit 7313a55

Browse files
committed
syntax: Remove diagnostic validation temporarily
This commit removes the syntax diagnostic validation as it's been plauging the bots for two separate reasons and needs a quick fix for now: 1. It's possible to read the stale metadata of previous builds, causing spurious failures that can only be solved by blowing away `tmp`. 2. The code does not currently handle concurrent compilations where JSON files in the metadata directory may be half-written and hence contain invalid JSON when read. This validation should come back, but it should likely be part of a lint pass run at the very end of the build that doesn't run into consistency or concurrency problems.
1 parent 8dbc369 commit 7313a55

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

src/libsyntax/diagnostics/plugin.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use std::collections::BTreeMap;
1414
use ast;
1515
use ast::{Ident, Name, TokenTree};
1616
use codemap::Span;
17-
use diagnostics::metadata::{check_uniqueness, output_metadata, Duplicate};
1817
use ext::base::{ExtCtxt, MacEager, MacResult};
1918
use ext::build::AstBuilder;
2019
use parse::token;
@@ -148,7 +147,7 @@ pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
148147
token_tree: &[TokenTree])
149148
-> Box<MacResult+'cx> {
150149
assert_eq!(token_tree.len(), 3);
151-
let (crate_name, name) = match (&token_tree[0], &token_tree[2]) {
150+
let (_crate_name, name) = match (&token_tree[0], &token_tree[2]) {
152151
(
153152
// Crate name.
154153
&ast::TtToken(_, token::Ident(ref crate_name, _)),
@@ -158,22 +157,6 @@ pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
158157
_ => unreachable!()
159158
};
160159

161-
// Check uniqueness of errors and output metadata.
162-
with_registered_diagnostics(|diagnostics| {
163-
match check_uniqueness(crate_name, &*diagnostics) {
164-
Ok(Duplicate(err, location)) => {
165-
ecx.span_err(span, &format!(
166-
"error {} from `{}' also found in `{}'",
167-
err, crate_name, location
168-
));
169-
},
170-
Ok(_) => (),
171-
Err(e) => panic!("{}", e.description())
172-
}
173-
174-
output_metadata(&*ecx, crate_name, &*diagnostics).ok().expect("metadata output error");
175-
});
176-
177160
// Construct the output expression.
178161
let (count, expr) =
179162
with_registered_diagnostics(|diagnostics| {

0 commit comments

Comments
 (0)