10
10
11
11
use std:: cell:: RefCell ;
12
12
use std:: collections:: BTreeMap ;
13
+ use std:: error:: Error ;
13
14
14
15
use ast;
15
16
use ast:: { Ident , Name , TokenTree } ;
16
17
use codemap:: Span ;
17
- use diagnostics:: metadata:: { check_uniqueness, output_metadata, Duplicate } ;
18
18
use ext:: base:: { ExtCtxt , MacEager , MacResult } ;
19
19
use ext:: build:: AstBuilder ;
20
20
use parse:: token;
@@ -148,7 +148,7 @@ pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
148
148
token_tree : & [ TokenTree ] )
149
149
-> Box < MacResult +' cx > {
150
150
assert_eq ! ( token_tree. len( ) , 3 ) ;
151
- let ( crate_name , name) = match ( & token_tree[ 0 ] , & token_tree[ 2 ] ) {
151
+ let ( _crate_name , name) = match ( & token_tree[ 0 ] , & token_tree[ 2 ] ) {
152
152
(
153
153
// Crate name.
154
154
& ast:: TtToken ( _, token:: Ident ( ref crate_name, _) ) ,
@@ -158,21 +158,9 @@ pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
158
158
_ => unreachable ! ( )
159
159
} ;
160
160
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
- } ) ;
161
+ // FIXME (#25705): we used to ensure error code uniqueness and
162
+ // output error description JSON metadata here, but the approach
163
+ // employed was too brittle.
176
164
177
165
// Construct the output expression.
178
166
let ( count, expr) =
0 commit comments