Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emitter cleanups #119601

Merged
merged 5 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename AnnotateSnippetEmitterWriter as AnnotateSnippetEmitter.
For consistency with other `Emitter` impls.
  • Loading branch information
nnethercote committed Jan 4, 2024
commit c4d63c7f760d23c2f5c509fa08a0b0afd34fd6fb
8 changes: 4 additions & 4 deletions compiler/rustc_errors/src/annotate_snippet_emitter_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use rustc_span::source_map::SourceMap;
use rustc_span::SourceFile;

/// Generates diagnostics using annotate-snippet
pub struct AnnotateSnippetEmitterWriter {
pub struct AnnotateSnippetEmitter {
source_map: Option<Lrc<SourceMap>>,
fluent_bundle: Option<Lrc<FluentBundle>>,
fallback_bundle: LazyFallbackBundle,
Expand All @@ -33,7 +33,7 @@ pub struct AnnotateSnippetEmitterWriter {
macro_backtrace: bool,
}

impl Translate for AnnotateSnippetEmitterWriter {
impl Translate for AnnotateSnippetEmitter {
fn fluent_bundle(&self) -> Option<&Lrc<FluentBundle>> {
self.fluent_bundle.as_ref()
}
Expand All @@ -43,7 +43,7 @@ impl Translate for AnnotateSnippetEmitterWriter {
}
}

impl Emitter for AnnotateSnippetEmitterWriter {
impl Emitter for AnnotateSnippetEmitter {
/// The entry point for the diagnostics generation
fn emit_diagnostic(&mut self, diag: &Diagnostic) {
let fluent_args = to_fluent_args(diag.args());
Expand Down Expand Up @@ -99,7 +99,7 @@ fn annotation_type_for_level(level: Level) -> AnnotationType {
}
}

impl AnnotateSnippetEmitterWriter {
impl AnnotateSnippetEmitter {
pub fn new(
source_map: Option<Lrc<SourceMap>>,
fluent_bundle: Option<Lrc<FluentBundle>>,
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_session/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use rustc_data_structures::profiling::{SelfProfiler, SelfProfilerRef};
use rustc_data_structures::sync::{
AtomicU64, DynSend, DynSync, Lock, Lrc, OneThread, Ordering::SeqCst,
};
use rustc_errors::annotate_snippet_emitter_writer::AnnotateSnippetEmitterWriter;
use rustc_errors::annotate_snippet_emitter_writer::AnnotateSnippetEmitter;
use rustc_errors::emitter::{DynEmitter, HumanEmitter, HumanReadableErrorType};
use rustc_errors::json::JsonEmitter;
use rustc_errors::registry::Registry;
Expand Down Expand Up @@ -1000,7 +1000,7 @@ fn default_emitter(
let (short, color_config) = kind.unzip();

if let HumanReadableErrorType::AnnotateSnippet(_) = kind {
let emitter = AnnotateSnippetEmitterWriter::new(
let emitter = AnnotateSnippetEmitter::new(
Some(source_map),
bundle,
fallback_bundle,
Expand Down