File tree 1 file changed +12
-1
lines changed
src/libsyntax/diagnostics
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 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 } ;
@@ -163,7 +164,17 @@ pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
163
164
// FIXME (25364, 25592): used to ensure error code uniqueness
164
165
// here, but the approach employed was too brittle. Need to
165
166
// put such a check back in (e.g. in `make tidy`).
166
- output_metadata ( & * ecx, crate_name, & * diagnostics) . ok ( ) . expect ( "metadata output error" ) ;
167
+ match output_metadata ( & * ecx, crate_name, & * diagnostics) {
168
+ Ok ( ( ) ) => { }
169
+ Err ( error) => {
170
+ ecx. span_err ( span, & format ! ( "metadata output error {}" , error. description( ) ) ) ;
171
+ let mut error: & Error = & * error;
172
+ while let Some ( cause) = error. cause ( ) {
173
+ error = cause;
174
+ ecx. span_err ( span, & format ! ( "caused by error {}" , error. description( ) ) ) ;
175
+ }
176
+ }
177
+ }
167
178
} ) ;
168
179
169
180
// Construct the output expression.
You can’t perform that action at this time.
0 commit comments