Skip to content

Commit

Permalink
Rename emit_struct->emit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Turner committed Jul 14, 2016
1 parent 55f0688 commit a6e7239
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/librustc_errors/emitter.rs
Expand Up @@ -29,7 +29,7 @@ use term;
/// implement `CoreEmitter` instead.
pub trait Emitter {
/// Emit a structured diagnostic.
fn emit_struct(&mut self, db: &DiagnosticBuilder);
fn emit(&mut self, db: &DiagnosticBuilder);
}

pub trait CoreEmitter {
Expand All @@ -43,7 +43,7 @@ pub trait CoreEmitter {
}

impl<T: CoreEmitter> Emitter for T {
fn emit_struct(&mut self, db: &DiagnosticBuilder) {
fn emit(&mut self, db: &DiagnosticBuilder) {
let old_school = check_old_skool();
let db_span = FullSpan(db.span.clone());
self.emit_message(&FullSpan(db.span.clone()),
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_errors/lib.rs
Expand Up @@ -238,7 +238,7 @@ impl<'a> DiagnosticBuilder<'a> {
return;
}

self.handler.emit.borrow_mut().emit_struct(&self);
self.handler.emitter.borrow_mut().emit(&self);
self.cancel();
self.handler.panic_if_treat_err_as_bug();

Expand Down Expand Up @@ -420,7 +420,7 @@ impl<'a> Drop for DiagnosticBuilder<'a> {
/// others log errors for later reporting.
pub struct Handler {
err_count: Cell<usize>,
emit: RefCell<Box<Emitter>>,
emitter: RefCell<Box<Emitter>>,
pub can_emit_warnings: bool,
treat_err_as_bug: bool,
continue_after_error: Cell<bool>,
Expand All @@ -444,7 +444,7 @@ impl Handler {
e: Box<Emitter>) -> Handler {
Handler {
err_count: Cell::new(0),
emit: RefCell::new(e),
emitter: RefCell::new(e),
can_emit_warnings: can_emit_warnings,
treat_err_as_bug: treat_err_as_bug,
continue_after_error: Cell::new(true),
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/json.rs
Expand Up @@ -53,7 +53,7 @@ impl JsonEmitter {
}

impl Emitter for JsonEmitter {
fn emit_struct(&mut self, db: &DiagnosticBuilder) {
fn emit(&mut self, db: &DiagnosticBuilder) {
let data = Diagnostic::from_diagnostic_builder(db, self);
if let Err(e) = writeln!(&mut self.dst, "{}", as_json(&data)) {
panic!("failed to print diagnostics: {:?}", e);
Expand Down

0 comments on commit a6e7239

Please sign in to comment.