File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
compiler/rustc_errors/src Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -405,9 +405,8 @@ impl Diagnostic {
405
405
. collect ( ) ;
406
406
407
407
let buf = BufWriter :: default ( ) ;
408
- let output = buf. clone ( ) ;
409
408
je. json_rendered
410
- . new_emitter ( Box :: new ( buf) , je. fallback_bundle . clone ( ) )
409
+ . new_emitter ( Box :: new ( buf. clone ( ) ) , je. fallback_bundle . clone ( ) )
411
410
. sm ( Some ( je. sm . clone ( ) ) )
412
411
. fluent_bundle ( je. fluent_bundle . clone ( ) )
413
412
. diagnostic_width ( je. diagnostic_width )
@@ -417,16 +416,16 @@ impl Diagnostic {
417
416
. ui_testing ( je. ui_testing )
418
417
. ignored_directories_in_source_blocks ( je. ignored_directories_in_source_blocks . clone ( ) )
419
418
. emit_diagnostic ( diag) ;
420
- let output = Arc :: try_unwrap ( output . 0 ) . unwrap ( ) . into_inner ( ) . unwrap ( ) ;
421
- let output = String :: from_utf8 ( output ) . unwrap ( ) ;
419
+ let buf = Arc :: try_unwrap ( buf . 0 ) . unwrap ( ) . into_inner ( ) . unwrap ( ) ;
420
+ let buf = String :: from_utf8 ( buf ) . unwrap ( ) ;
422
421
423
422
Diagnostic {
424
423
message : translated_message. to_string ( ) ,
425
424
code,
426
425
level,
427
426
spans,
428
427
children,
429
- rendered : Some ( output ) ,
428
+ rendered : Some ( buf ) ,
430
429
}
431
430
}
432
431
You can’t perform that action at this time.
0 commit comments