@@ -14,8 +14,11 @@ use rustc_data_structures::memmap::Mmap;
14
14
use rustc_data_structures:: profiling:: { SelfProfilerRef , VerboseTimingGuard } ;
15
15
use rustc_data_structures:: sync:: Lrc ;
16
16
use 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
+ } ;
19
22
use rustc_fs_util:: link_or_copy;
20
23
use rustc_hir:: def_id:: { CrateNum , LOCAL_CRATE } ;
21
24
use rustc_incremental:: {
@@ -995,11 +998,9 @@ pub(crate) enum Message<B: WriteBackendMethods> {
995
998
/// process another codegen unit.
996
999
pub struct CguMessage ;
997
1000
998
- type DiagnosticArgName < ' source > = Cow < ' source , str > ;
999
-
1000
1001
struct Diagnostic {
1001
1002
msgs : Vec < ( DiagnosticMessage , Style ) > ,
1002
- args : FxHashMap < DiagnosticArgName < ' static > , rustc_errors :: DiagnosticArgValue > ,
1003
+ args : FxHashMap < DiagnosticArgName < ' static > , DiagnosticArgValue > ,
1003
1004
code : Option < ErrCode > ,
1004
1005
lvl : Level ,
1005
1006
}
@@ -1800,18 +1801,18 @@ impl SharedEmitter {
1800
1801
}
1801
1802
1802
1803
impl Translate for SharedEmitter {
1803
- fn fluent_bundle ( & self ) -> Option < & Lrc < rustc_errors :: FluentBundle > > {
1804
+ fn fluent_bundle ( & self ) -> Option < & Lrc < FluentBundle > > {
1804
1805
None
1805
1806
}
1806
1807
1807
- fn fallback_fluent_bundle ( & self ) -> & rustc_errors :: FluentBundle {
1808
+ fn fallback_fluent_bundle ( & self ) -> & FluentBundle {
1808
1809
panic ! ( "shared emitter attempted to translate a diagnostic" ) ;
1809
1810
}
1810
1811
}
1811
1812
1812
1813
impl Emitter for SharedEmitter {
1813
1814
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 > =
1815
1816
diag. args ( ) . map ( |( name, arg) | ( name. clone ( ) , arg. clone ( ) ) ) . collect ( ) ;
1816
1817
drop ( self . sender . send ( SharedEmitterMessage :: Diagnostic ( Diagnostic {
1817
1818
msgs : diag. messages . clone ( ) ,
0 commit comments