@@ -27,26 +27,43 @@ extern crate tracing;
27
27
28
28
extern crate self as rustc_errors;
29
29
30
+ pub use diagnostic:: {
31
+ AddToDiagnostic , DecorateLint , Diagnostic , DiagnosticArg , DiagnosticArgValue , DiagnosticId ,
32
+ DiagnosticStyledString , IntoDiagnosticArg , SubDiagnostic ,
33
+ } ;
34
+ pub use diagnostic_builder:: {
35
+ BugAbort , DiagnosticBuilder , EmissionGuarantee , FatalAbort , IntoDiagnostic ,
36
+ } ;
37
+ pub use diagnostic_impls:: {
38
+ DiagnosticArgFromDisplay , DiagnosticSymbolList , ExpectedLifetimeParameter ,
39
+ IndicateAnonymousLifetime , InvalidFlushedDelayedDiagnosticLevel , LabelKind ,
40
+ SingleLabelManySpans ,
41
+ } ;
30
42
pub use emitter:: ColorConfig ;
43
+ pub use rustc_error_messages:: {
44
+ fallback_fluent_bundle, fluent_bundle, DelayDm , DiagnosticMessage , FluentBundle ,
45
+ LanguageIdentifier , LazyFallbackBundle , MultiSpan , SpanLabel , SubdiagnosticMessage ,
46
+ } ;
47
+ pub use rustc_lint_defs:: { pluralize, Applicability } ;
48
+ pub use rustc_span:: fatal_error:: { FatalError , FatalErrorMarker } ;
49
+ pub use rustc_span:: ErrorGuaranteed ;
50
+ pub use snippet:: Style ;
31
51
32
- use rustc_lint_defs:: LintExpectationId ;
33
- use Level :: * ;
52
+ // Used by external projects such as `rust-gpu`.
53
+ // See https://github.com/rust-lang/rust/pull/115393.
54
+ pub use termcolor:: { Color , ColorSpec , WriteColor } ;
34
55
56
+ use crate :: diagnostic_impls:: { DelayedAtWithNewline , DelayedAtWithoutNewline } ;
35
57
use emitter:: { is_case_difference, DynEmitter , Emitter , EmitterWriter } ;
36
58
use registry:: Registry ;
37
59
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet , FxIndexMap , FxIndexSet } ;
38
60
use rustc_data_structures:: stable_hasher:: { Hash128 , StableHasher } ;
39
61
use rustc_data_structures:: sync:: { Lock , Lrc } ;
40
62
use rustc_data_structures:: AtomicRef ;
41
- pub use rustc_error_messages:: {
42
- fallback_fluent_bundle, fluent_bundle, DelayDm , DiagnosticMessage , FluentBundle ,
43
- LanguageIdentifier , LazyFallbackBundle , MultiSpan , SpanLabel , SubdiagnosticMessage ,
44
- } ;
45
- pub use rustc_lint_defs:: { pluralize, Applicability } ;
63
+ use rustc_lint_defs:: LintExpectationId ;
46
64
use rustc_span:: source_map:: SourceMap ;
47
- pub use rustc_span:: ErrorGuaranteed ;
48
65
use rustc_span:: { Loc , Span , DUMMY_SP } ;
49
-
66
+ use std :: backtrace :: { Backtrace , BacktraceStatus } ;
50
67
use std:: borrow:: Cow ;
51
68
use std:: error:: Report ;
52
69
use std:: fmt;
@@ -56,9 +73,7 @@ use std::num::NonZeroUsize;
56
73
use std:: panic;
57
74
use std:: path:: { Path , PathBuf } ;
58
75
59
- // Used by external projects such as `rust-gpu`.
60
- // See https://github.com/rust-lang/rust/pull/115393.
61
- pub use termcolor:: { Color , ColorSpec , WriteColor } ;
76
+ use Level :: * ;
62
77
63
78
pub mod annotate_snippet_emitter_writer;
64
79
mod diagnostic;
@@ -76,9 +91,6 @@ mod styled_buffer;
76
91
mod tests;
77
92
pub mod translation;
78
93
79
- pub use diagnostic_builder:: IntoDiagnostic ;
80
- pub use snippet:: Style ;
81
-
82
94
pub type PErr < ' a > = DiagnosticBuilder < ' a , ErrorGuaranteed > ;
83
95
pub type PResult < ' a , T > = Result < T , PErr < ' a > > ;
84
96
@@ -387,8 +399,6 @@ impl CodeSuggestion {
387
399
}
388
400
}
389
401
390
- pub use rustc_span:: fatal_error:: { FatalError , FatalErrorMarker } ;
391
-
392
402
/// Signifies that the compiler died with an explicit call to `.bug`
393
403
/// or `.span_bug` rather than a failed assertion, etc.
394
404
pub struct ExplicitBug ;
@@ -397,19 +407,6 @@ pub struct ExplicitBug;
397
407
/// rather than a failed assertion, etc.
398
408
pub struct DelayedBugPanic ;
399
409
400
- use crate :: diagnostic_impls:: { DelayedAtWithNewline , DelayedAtWithoutNewline } ;
401
- pub use diagnostic:: {
402
- AddToDiagnostic , DecorateLint , Diagnostic , DiagnosticArg , DiagnosticArgValue , DiagnosticId ,
403
- DiagnosticStyledString , IntoDiagnosticArg , SubDiagnostic ,
404
- } ;
405
- pub use diagnostic_builder:: { BugAbort , DiagnosticBuilder , EmissionGuarantee , FatalAbort } ;
406
- pub use diagnostic_impls:: {
407
- DiagnosticArgFromDisplay , DiagnosticSymbolList , ExpectedLifetimeParameter ,
408
- IndicateAnonymousLifetime , InvalidFlushedDelayedDiagnosticLevel , LabelKind ,
409
- SingleLabelManySpans ,
410
- } ;
411
- use std:: backtrace:: { Backtrace , BacktraceStatus } ;
412
-
413
410
/// A handler deals with errors and other compiler output.
414
411
/// Certain errors (fatal, bug, unimpl) may cause immediate exit,
415
412
/// others log errors for later reporting.
0 commit comments