Skip to content

Commit

Permalink
Make emitter handle DUMMY_SP correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Jan 26, 2016
1 parent 1745153 commit d829019
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libsyntax/errors/emitter.rs
Expand Up @@ -10,7 +10,7 @@

use self::Destination::*;

use codemap::{self, COMMAND_LINE_SP, COMMAND_LINE_EXPN, Pos, Span};
use codemap::{self, COMMAND_LINE_SP, COMMAND_LINE_EXPN, DUMMY_SP, Pos, Span};
use diagnostics;

use errors::{Level, RenderSpan, DiagnosticBuilder};
Expand Down Expand Up @@ -109,8 +109,8 @@ impl Emitter for EmitterWriter {
lvl: Level) {
let error = match sp {
Some(COMMAND_LINE_SP) => self.emit_(FileLine(COMMAND_LINE_SP), msg, code, lvl),
Some(DUMMY_SP) | None => print_diagnostic(&mut self.dst, "", lvl, msg, code),
Some(sp) => self.emit_(FullSpan(sp), msg, code, lvl),
None => print_diagnostic(&mut self.dst, "", lvl, msg, code),
};

if let Err(e) = error {
Expand Down

0 comments on commit d829019

Please sign in to comment.