Skip to content

Commit 8189864

Browse files
committed
This commit removes the syntax diagnostic validation as it's been plaguing 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. ---- This commit is a revised version of PR #25592; this approach differs in that it continues to output the JSON metadata, so that the error index page continues to work (assuming that people do not accidentally put in duplicate entries in the meantime).
1 parent 7bd3bbd commit 8189864

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/libsyntax/diagnostics/plugin.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ 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};
17+
use diagnostics::metadata::{output_metadata};
1818
use ext::base::{ExtCtxt, MacEager, MacResult};
1919
use ext::build::AstBuilder;
2020
use parse::token;
@@ -158,19 +158,11 @@ pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
158158
_ => unreachable!()
159159
};
160160

161-
// Check uniqueness of errors and output metadata.
161+
// Output metadata.
162162
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-
163+
// FIXME (25364, 25592): used to ensure error code uniqueness
164+
// here, but the approach employed was too brittle. Need to
165+
// put such a check back in (e.g. in `make tidy`).
174166
output_metadata(&*ecx, crate_name, &*diagnostics).ok().expect("metadata output error");
175167
});
176168

0 commit comments

Comments
 (0)