about summary refs log tree commit diff
path: root/src/librustc_errors
diff options
context:
space:
mode:
authorPhilipp Hansch <dev@phansch.net>2019-06-05 21:13:56 +0200
committerPhilipp Hansch <dev@phansch.net>2019-06-05 21:43:55 +0200
commitdf076b2d5e21bd62263efbb1a6345492a7e302ca (patch)
tree063cbf531814dd2d361e5ae8093cf5ebda8de63d /src/librustc_errors
parent47f4975cd751a03c941431b35cd7a6cba6201730 (diff)
downloadrust-df076b2d5e21bd62263efbb1a6345492a7e302ca.tar.gz
rust-df076b2d5e21bd62263efbb1a6345492a7e302ca.zip
librustc_errors: Rename AnnotateRs -> AnnotateSnippet
The proper name of the library is `annotate-snippet`, not `annotate-rs`,
this commit should get rid of any confusing `AnnotateRs` names.

1. Renames `annotate_rs_emitter.rs` to
   `annotate_snippet_emitter_writer.rs` so that the difference between the
   `Emitter` trait and the implementers is more clear.
2. Renames `AnnotateRsEmitterWriter` to `AnnotateSnippetEmitterWriter`
3. Renames `HumanReadableErrorType::AnnotateRs` to `HumanReadableErrorType::AnnotateSnippet`
Diffstat (limited to 'src/librustc_errors')
-rw-r--r--src/librustc_errors/annotate_snippet_emitter_writer.rs (renamed from src/librustc_errors/annotate_rs_emitter.rs)20
-rw-r--r--src/librustc_errors/emitter.rs4
-rw-r--r--src/librustc_errors/lib.rs2
3 files changed, 13 insertions, 13 deletions
diff --git a/src/librustc_errors/annotate_rs_emitter.rs b/src/librustc_errors/annotate_snippet_emitter_writer.rs
index de42389de74..9f9c7588d97 100644
--- a/src/librustc_errors/annotate_rs_emitter.rs
+++ b/src/librustc_errors/annotate_snippet_emitter_writer.rs
@@ -1,9 +1,9 @@
-/// Emit diagnostics using the `annotate-snippets` library
-///
-/// This is the equivalent of `./emitter.rs` but making use of the
-/// [`annotate-snippets`][annotate_snippets] library instead of building the output ourselves.
-///
-/// [annotate_snippets]: https://docs.rs/crate/annotate-snippets/
+//! Emit diagnostics using the `annotate-snippets` library
+//!
+//! This is the equivalent of `./emitter.rs` but making use of the
+//! [`annotate-snippets`][annotate_snippets] library instead of building the output ourselves.
+//!
+//! [annotate_snippets]: https://docs.rs/crate/annotate-snippets/
 
 use syntax_pos::{SourceFile, MultiSpan, Loc};
 use crate::{
@@ -18,8 +18,8 @@ use annotate_snippets::display_list::DisplayList;
 use annotate_snippets::formatter::DisplayListFormatter;
 
 
-/// Generates diagnostics using annotate-rs
-pub struct AnnotateRsEmitterWriter {
+/// Generates diagnostics using annotate-snippet
+pub struct AnnotateSnippetEmitterWriter {
     source_map: Option<Lrc<SourceMapperDyn>>,
     /// If true, hides the longer explanation text
     short_message: bool,
@@ -27,7 +27,7 @@ pub struct AnnotateRsEmitterWriter {
     ui_testing: bool,
 }
 
-impl Emitter for AnnotateRsEmitterWriter {
+impl Emitter for AnnotateSnippetEmitterWriter {
     /// The entry point for the diagnostics generation
     fn emit_diagnostic(&mut self, db: &DiagnosticBuilder<'_>) {
         let primary_span = db.span.clone();
@@ -158,7 +158,7 @@ impl<'a>  DiagnosticConverter<'a> {
     }
 }
 
-impl AnnotateRsEmitterWriter {
+impl AnnotateSnippetEmitterWriter {
     pub fn new(
         source_map: Option<Lrc<SourceMapperDyn>>,
         short_message: bool
diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs
index fcc0358ea7c..3bf477efe35 100644
--- a/src/librustc_errors/emitter.rs
+++ b/src/librustc_errors/emitter.rs
@@ -24,7 +24,7 @@ use termcolor::{WriteColor, Color, Buffer};
 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
 pub enum HumanReadableErrorType {
     Default(ColorConfig),
-    AnnotateRs(ColorConfig),
+    AnnotateSnippet(ColorConfig),
     Short(ColorConfig),
 }
 
@@ -34,7 +34,7 @@ impl HumanReadableErrorType {
         match self {
             HumanReadableErrorType::Default(cc) => (false, cc),
             HumanReadableErrorType::Short(cc) => (true, cc),
-            HumanReadableErrorType::AnnotateRs(cc) => (false, cc),
+            HumanReadableErrorType::AnnotateSnippet(cc) => (false, cc),
         }
     }
     pub fn new_emitter(
diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs
index 7bc7d0ddaf2..1831d58e736 100644
--- a/src/librustc_errors/lib.rs
+++ b/src/librustc_errors/lib.rs
@@ -33,7 +33,7 @@ use termcolor::{ColorSpec, Color};
 mod diagnostic;
 mod diagnostic_builder;
 pub mod emitter;
-pub mod annotate_rs_emitter;
+pub mod annotate_snippet_emitter_writer;
 mod snippet;
 pub mod registry;
 mod styled_buffer;