This repository was archived by the owner on May 28, 2025. It is now read-only.
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 {
405405 . collect ( ) ;
406406
407407 let buf = BufWriter :: default ( ) ;
408- let output = buf. clone ( ) ;
409408 je. json_rendered
410- . new_emitter ( Box :: new ( buf) , je. fallback_bundle . clone ( ) )
409+ . new_emitter ( Box :: new ( buf. clone ( ) ) , je. fallback_bundle . clone ( ) )
411410 . sm ( Some ( je. sm . clone ( ) ) )
412411 . fluent_bundle ( je. fluent_bundle . clone ( ) )
413412 . diagnostic_width ( je. diagnostic_width )
@@ -417,16 +416,16 @@ impl Diagnostic {
417416 . ui_testing ( je. ui_testing )
418417 . ignored_directories_in_source_blocks ( je. ignored_directories_in_source_blocks . clone ( ) )
419418 . 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 ( ) ;
422421
423422 Diagnostic {
424423 message : translated_message. to_string ( ) ,
425424 code,
426425 level,
427426 spans,
428427 children,
429- rendered : Some ( output ) ,
428+ rendered : Some ( buf ) ,
430429 }
431430 }
432431
You can’t perform that action at this time.
0 commit comments