use crate::styled_buffer::StyledBuffer;
use crate::{
CodeSuggestion, Diagnostic, DiagnosticArg, DiagnosticId, DiagnosticMessage, FluentBundle,
- Handler, Level, MultiSpan, SubDiagnostic, SubstitutionHighlight, SuggestionStyle,
+ Handler, LazyFallbackBundle, Level, MultiSpan, SubDiagnostic, SubstitutionHighlight,
+ SuggestionStyle,
};
use rustc_lint_defs::pluralize;
dst: Box<dyn Write + Send>,
source_map: Option<Lrc<SourceMap>>,
bundle: Option<Lrc<FluentBundle>>,
- fallback_bundle: Lrc<FluentBundle>,
+ fallback_bundle: LazyFallbackBundle,
teach: bool,
terminal_width: Option<usize>,
macro_backtrace: bool,
fn emit_future_breakage_report(&mut self, _diags: Vec<Diagnostic>) {}
/// Emit list of unused externs
- fn emit_unused_externs(&mut self, _lint_level: &str, _unused_externs: &[&str]) {}
+ fn emit_unused_externs(
+ &mut self,
+ _lint_level: rustc_lint_defs::Level,
+ _unused_externs: &[&str],
+ ) {
+ }
/// Checks if should show explanations about "rustc --explain"
fn should_show_explain(&self) -> bool {
/// Return `FluentBundle` with localized diagnostics for the default locale of the compiler.
/// Used when the user has not requested a specific language or when a localized diagnostic is
/// unavailable for the requested locale.
- fn fallback_fluent_bundle(&self) -> &Lrc<FluentBundle>;
+ fn fallback_fluent_bundle(&self) -> &FluentBundle;
/// Convert diagnostic arguments (a rustc internal type that exists to implement
/// `Encodable`/`Decodable`) into `FluentArgs` which is necessary to perform translation.
self.fluent_bundle.as_ref()
}
- fn fallback_fluent_bundle(&self) -> &Lrc<FluentBundle> {
- &self.fallback_bundle
+ fn fallback_fluent_bundle(&self) -> &FluentBundle {
+ &**self.fallback_bundle
}
fn emit_diagnostic(&mut self, diag: &Diagnostic) {
None
}
- fn fallback_fluent_bundle(&self) -> &Lrc<FluentBundle> {
+ fn fallback_fluent_bundle(&self) -> &FluentBundle {
panic!("silent emitter attempted to translate message")
}
dst: Destination,
sm: Option<Lrc<SourceMap>>,
fluent_bundle: Option<Lrc<FluentBundle>>,
- fallback_bundle: Lrc<FluentBundle>,
+ fallback_bundle: LazyFallbackBundle,
short_message: bool,
teach: bool,
ui_testing: bool,
color_config: ColorConfig,
source_map: Option<Lrc<SourceMap>>,
fluent_bundle: Option<Lrc<FluentBundle>>,
- fallback_bundle: Lrc<FluentBundle>,
+ fallback_bundle: LazyFallbackBundle,
short_message: bool,
teach: bool,
terminal_width: Option<usize>,
dst: Box<dyn Write + Send>,
source_map: Option<Lrc<SourceMap>>,
fluent_bundle: Option<Lrc<FluentBundle>>,
- fallback_bundle: Lrc<FluentBundle>,
+ fallback_bundle: LazyFallbackBundle,
short_message: bool,
teach: bool,
colored: bool,