Skip to content

Remove error diagnostics uniqueness check and .json generation. #25706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion mk/docs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ ERR_IDX_GEN = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(ERR_IDX_GEN_EXE)

D := $(S)src/doc

DOC_TARGETS := trpl style error-index
# FIXME (#25705) eventually may want to put error-index target back here.
DOC_TARGETS := trpl style
COMPILER_DOC_TARGETS :=
DOC_L10N_TARGETS :=

Expand Down
21 changes: 4 additions & 17 deletions src/libsyntax/diagnostics/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use std::collections::BTreeMap;
use ast;
use ast::{Ident, Name, TokenTree};
use codemap::Span;
use diagnostics::metadata::{check_uniqueness, output_metadata, Duplicate};
use ext::base::{ExtCtxt, MacEager, MacResult};
use ext::build::AstBuilder;
use parse::token;
Expand Down Expand Up @@ -148,7 +147,7 @@ pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
token_tree: &[TokenTree])
-> Box<MacResult+'cx> {
assert_eq!(token_tree.len(), 3);
let (crate_name, name) = match (&token_tree[0], &token_tree[2]) {
let (_crate_name, name) = match (&token_tree[0], &token_tree[2]) {
(
// Crate name.
&ast::TtToken(_, token::Ident(ref crate_name, _)),
Expand All @@ -158,21 +157,9 @@ pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
_ => unreachable!()
};

// Check uniqueness of errors and output metadata.
with_registered_diagnostics(|diagnostics| {
match check_uniqueness(crate_name, &*diagnostics) {
Ok(Duplicate(err, location)) => {
ecx.span_err(span, &format!(
"error {} from `{}' also found in `{}'",
err, crate_name, location
));
},
Ok(_) => (),
Err(e) => panic!("{}", e.description())
}

output_metadata(&*ecx, crate_name, &*diagnostics).ok().expect("metadata output error");
});
// FIXME (#25705): we used to ensure error code uniqueness and
// output error description JSON metadata here, but the approach
// employed was too brittle.

// Construct the output expression.
let (count, expr) =
Expand Down