@@ -1002,11 +1002,12 @@ pub struct CguMessage;
1002
1002
// A cut-down version of `rustc_errors::Diagnostic` that impls `Send`, which
1003
1003
// can be used to send diagnostics from codegen threads to the main thread.
1004
1004
// It's missing the following fields from `rustc_errors::Diagnostic`.
1005
- // - `span`: because `MultiSpan` doesn't impl `Send`.
1006
- // - `suggestions`: because it doesn't impl `Send`, and is not worth the complexity.
1007
- // - `sort_span`: because `Span` doesn't impl `Send`.
1008
- // - `is_lint`: because lints aren't relevant during codegen.
1009
- // - `emitted_at`: not worth the complexity.
1005
+ // - `span`: it doesn't impl `Send`.
1006
+ // - `suggestions`: it doesn't impl `Send`, and isn't used for codegen
1007
+ // diagnostics.
1008
+ // - `sort_span`: it doesn't impl `Send`.
1009
+ // - `is_lint`: lints aren't relevant during codegen.
1010
+ // - `emitted_at`: not used for codegen diagnostics.
1010
1011
struct Diagnostic {
1011
1012
level : Level ,
1012
1013
messages : Vec < ( DiagnosticMessage , Style ) > ,
@@ -1017,7 +1018,7 @@ struct Diagnostic {
1017
1018
1018
1019
// A cut-down version of `rustc_errors::SubDiagnostic` that impls `Send`. It's
1019
1020
// missing the following fields from `rustc_errors::SubDiagnostic`.
1020
- // - `span`: because `MultiSpan` doesn't impl `Send`.
1021
+ // - `span`: it doesn't impl `Send`.
1021
1022
pub struct Subdiagnostic {
1022
1023
level : Level ,
1023
1024
messages : Vec < ( DiagnosticMessage , Style ) > ,
@@ -1783,7 +1784,6 @@ fn spawn_work<'a, B: ExtraBackendMethods>(
1783
1784
enum SharedEmitterMessage {
1784
1785
Diagnostic ( Diagnostic ) ,
1785
1786
InlineAsmError ( u32 , String , Level , Option < ( String , Vec < InnerSpan > ) > ) ,
1786
- AbortIfErrors ,
1787
1787
Fatal ( String ) ,
1788
1788
}
1789
1789
@@ -1852,7 +1852,6 @@ impl Emitter for SharedEmitter {
1852
1852
args,
1853
1853
} ) ) ,
1854
1854
) ;
1855
- drop ( self . sender . send ( SharedEmitterMessage :: AbortIfErrors ) ) ;
1856
1855
}
1857
1856
1858
1857
fn source_map ( & self ) -> Option < & Lrc < SourceMap > > {
@@ -1894,6 +1893,7 @@ impl SharedEmitterMain {
1894
1893
. collect ( ) ;
1895
1894
d. args = diag. args ;
1896
1895
dcx. emit_diagnostic ( d) ;
1896
+ sess. dcx ( ) . abort_if_errors ( ) ;
1897
1897
}
1898
1898
Ok ( SharedEmitterMessage :: InlineAsmError ( cookie, msg, level, source) ) => {
1899
1899
assert ! ( matches!( level, Level :: Error | Level :: Warning | Level :: Note ) ) ;
@@ -1926,9 +1926,6 @@ impl SharedEmitterMain {
1926
1926
1927
1927
err. emit ( ) ;
1928
1928
}
1929
- Ok ( SharedEmitterMessage :: AbortIfErrors ) => {
1930
- sess. dcx ( ) . abort_if_errors ( ) ;
1931
- }
1932
1929
Ok ( SharedEmitterMessage :: Fatal ( msg) ) => {
1933
1930
sess. dcx ( ) . fatal ( msg) ;
1934
1931
}
0 commit comments