Don't output bogus spans when reporting a message without one.
Emacs gets confused by <input>:0:0:0:0:
This commit is contained in:
parent
609e38d8e7
commit
805e3098c5
1 changed files with 3 additions and 3 deletions
|
@ -99,16 +99,16 @@ fn span_to_str(sp: &span, cm: &codemap) -> str {
|
|||
|
||||
fn emit_diagnostic(sp: &option::t<span>, msg: &str, kind: &str, color: u8,
|
||||
cm: &codemap) {
|
||||
let ss = "<input>:0:0:0:0";
|
||||
let ss = "";
|
||||
let maybe_lines: option::t<@file_lines> = none;
|
||||
alt sp {
|
||||
some(ssp) {
|
||||
ss = span_to_str(ssp, cm);
|
||||
ss = span_to_str(ssp, cm) + " ";
|
||||
maybe_lines = some(span_to_lines(ssp, cm));
|
||||
}
|
||||
none. { }
|
||||
}
|
||||
io::stdout().write_str(ss + " ");
|
||||
io::stdout().write_str(ss);
|
||||
if term::color_supported() {
|
||||
term::fg(io::stdout().get_buf_writer(), color);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue