@@ -1727,52 +1727,52 @@ enum IncrCompSession {
1727
1727
1728
1728
/// A wrapper around an [`DiagCtxt`] that is used for early error emissions.
1729
1729
pub struct EarlyDiagCtxt {
1730
- handler : DiagCtxt ,
1730
+ dcx : DiagCtxt ,
1731
1731
}
1732
1732
1733
1733
impl EarlyDiagCtxt {
1734
1734
pub fn new ( output : ErrorOutputType ) -> Self {
1735
1735
let emitter = mk_emitter ( output) ;
1736
- Self { handler : DiagCtxt :: with_emitter ( emitter) }
1736
+ Self { dcx : DiagCtxt :: with_emitter ( emitter) }
1737
1737
}
1738
1738
1739
1739
pub fn abort_if_errors ( & self ) {
1740
- self . handler . abort_if_errors ( )
1740
+ self . dcx . abort_if_errors ( )
1741
1741
}
1742
1742
1743
- /// Swap out the underlying handler once we acquire the user's preference on error emission
1743
+ /// Swap out the underlying dcx once we acquire the user's preference on error emission
1744
1744
/// format. Any errors prior to that will cause an abort and all stashed diagnostics of the
1745
- /// previous handler will be emitted.
1745
+ /// previous dcx will be emitted.
1746
1746
pub fn abort_if_error_and_set_error_format ( & mut self , output : ErrorOutputType ) {
1747
- self . handler . abort_if_errors ( ) ;
1747
+ self . dcx . abort_if_errors ( ) ;
1748
1748
1749
1749
let emitter = mk_emitter ( output) ;
1750
- self . handler = DiagCtxt :: with_emitter ( emitter) ;
1750
+ self . dcx = DiagCtxt :: with_emitter ( emitter) ;
1751
1751
}
1752
1752
1753
1753
#[ allow( rustc:: untranslatable_diagnostic) ]
1754
1754
#[ allow( rustc:: diagnostic_outside_of_impl) ]
1755
1755
pub fn early_note ( & self , msg : impl Into < DiagnosticMessage > ) {
1756
- self . handler . struct_note ( msg) . emit ( )
1756
+ self . dcx . struct_note ( msg) . emit ( )
1757
1757
}
1758
1758
1759
1759
#[ allow( rustc:: untranslatable_diagnostic) ]
1760
1760
#[ allow( rustc:: diagnostic_outside_of_impl) ]
1761
1761
pub fn early_help ( & self , msg : impl Into < DiagnosticMessage > ) {
1762
- self . handler . struct_help ( msg) . emit ( )
1762
+ self . dcx . struct_help ( msg) . emit ( )
1763
1763
}
1764
1764
1765
1765
#[ allow( rustc:: untranslatable_diagnostic) ]
1766
1766
#[ allow( rustc:: diagnostic_outside_of_impl) ]
1767
1767
#[ must_use = "ErrorGuaranteed must be returned from `run_compiler` in order to exit with a non-zero status code" ]
1768
1768
pub fn early_error_no_abort ( & self , msg : impl Into < DiagnosticMessage > ) -> ErrorGuaranteed {
1769
- self . handler . struct_err ( msg) . emit ( )
1769
+ self . dcx . struct_err ( msg) . emit ( )
1770
1770
}
1771
1771
1772
1772
#[ allow( rustc:: untranslatable_diagnostic) ]
1773
1773
#[ allow( rustc:: diagnostic_outside_of_impl) ]
1774
1774
pub fn early_error ( & self , msg : impl Into < DiagnosticMessage > ) -> ! {
1775
- self . handler . struct_fatal ( msg) . emit ( )
1775
+ self . dcx . struct_fatal ( msg) . emit ( )
1776
1776
}
1777
1777
1778
1778
#[ allow( rustc:: untranslatable_diagnostic) ]
@@ -1781,24 +1781,21 @@ impl EarlyDiagCtxt {
1781
1781
& self ,
1782
1782
msg : impl Into < DiagnosticMessage > ,
1783
1783
) -> DiagnosticBuilder < ' _ , !> {
1784
- self . handler . struct_fatal ( msg)
1784
+ self . dcx . struct_fatal ( msg)
1785
1785
}
1786
1786
1787
1787
#[ allow( rustc:: untranslatable_diagnostic) ]
1788
1788
#[ allow( rustc:: diagnostic_outside_of_impl) ]
1789
1789
pub fn early_warn ( & self , msg : impl Into < DiagnosticMessage > ) {
1790
- self . handler . struct_warn ( msg) . emit ( )
1790
+ self . dcx . struct_warn ( msg) . emit ( )
1791
1791
}
1792
1792
1793
1793
pub fn initialize_checked_jobserver ( & self ) {
1794
1794
// initialize jobserver before getting `jobserver::client` and `build_session`.
1795
1795
jobserver:: initialize_checked ( |err| {
1796
1796
#[ allow( rustc:: untranslatable_diagnostic) ]
1797
1797
#[ allow( rustc:: diagnostic_outside_of_impl) ]
1798
- self . handler
1799
- . struct_warn ( err)
1800
- . note ( "the build environment is likely misconfigured" )
1801
- . emit ( )
1798
+ self . dcx . struct_warn ( err) . note ( "the build environment is likely misconfigured" ) . emit ( )
1802
1799
} ) ;
1803
1800
}
1804
1801
}
0 commit comments