@@ -14,8 +14,11 @@ use rustc_data_structures::memmap::Mmap;
1414use rustc_data_structures:: profiling:: { SelfProfilerRef , VerboseTimingGuard } ;
1515use rustc_data_structures:: sync:: Lrc ;
1616use rustc_errors:: emitter:: Emitter ;
17- use rustc_errors:: { translation:: Translate , DiagCtxt , FatalError , Level } ;
18- use rustc_errors:: { DiagnosticBuilder , DiagnosticMessage , ErrCode , Style } ;
17+ use rustc_errors:: translation:: Translate ;
18+ use rustc_errors:: {
19+ DiagCtxt , DiagnosticArgName , DiagnosticArgValue , DiagnosticBuilder , DiagnosticMessage , ErrCode ,
20+ FatalError , FluentBundle , Level , Style ,
21+ } ;
1922use rustc_fs_util:: link_or_copy;
2023use rustc_hir:: def_id:: { CrateNum , LOCAL_CRATE } ;
2124use rustc_incremental:: {
@@ -995,11 +998,9 @@ pub(crate) enum Message<B: WriteBackendMethods> {
995998/// process another codegen unit.
996999pub struct CguMessage ;
9971000
998- type DiagnosticArgName < ' source > = Cow < ' source , str > ;
999-
10001001struct Diagnostic {
10011002 msgs : Vec < ( DiagnosticMessage , Style ) > ,
1002- args : FxHashMap < DiagnosticArgName < ' static > , rustc_errors :: DiagnosticArgValue > ,
1003+ args : FxHashMap < DiagnosticArgName < ' static > , DiagnosticArgValue > ,
10031004 code : Option < ErrCode > ,
10041005 lvl : Level ,
10051006}
@@ -1800,18 +1801,18 @@ impl SharedEmitter {
18001801}
18011802
18021803impl Translate for SharedEmitter {
1803- fn fluent_bundle ( & self ) -> Option < & Lrc < rustc_errors :: FluentBundle > > {
1804+ fn fluent_bundle ( & self ) -> Option < & Lrc < FluentBundle > > {
18041805 None
18051806 }
18061807
1807- fn fallback_fluent_bundle ( & self ) -> & rustc_errors :: FluentBundle {
1808+ fn fallback_fluent_bundle ( & self ) -> & FluentBundle {
18081809 panic ! ( "shared emitter attempted to translate a diagnostic" ) ;
18091810 }
18101811}
18111812
18121813impl Emitter for SharedEmitter {
18131814 fn emit_diagnostic ( & mut self , diag : & rustc_errors:: Diagnostic ) {
1814- let args: FxHashMap < Cow < ' _ , str > , rustc_errors :: DiagnosticArgValue > =
1815+ let args: FxHashMap < Cow < ' _ , str > , DiagnosticArgValue > =
18151816 diag. args ( ) . map ( |( name, arg) | ( name. clone ( ) , arg. clone ( ) ) ) . collect ( ) ;
18161817 drop ( self . sender . send ( SharedEmitterMessage :: Diagnostic ( Diagnostic {
18171818 msgs : diag. messages . clone ( ) ,
0 commit comments