syntax::diagnostic: Remove @ from Emitter
This commit is contained in:
parent
fe10c63326
commit
db204b20ab
2 changed files with 13 additions and 13 deletions
|
@ -348,7 +348,7 @@ struct RustcEmitter {
|
||||||
|
|
||||||
impl diagnostic::Emitter for RustcEmitter {
|
impl diagnostic::Emitter for RustcEmitter {
|
||||||
fn emit(&self,
|
fn emit(&self,
|
||||||
cmsp: Option<(@codemap::CodeMap, codemap::Span)>,
|
cmsp: Option<(&codemap::CodeMap, codemap::Span)>,
|
||||||
msg: &str,
|
msg: &str,
|
||||||
lvl: diagnostic::level) {
|
lvl: diagnostic::level) {
|
||||||
if lvl == diagnostic::fatal {
|
if lvl == diagnostic::fatal {
|
||||||
|
|
|
@ -21,7 +21,7 @@ static BUG_REPORT_URL: &'static str =
|
||||||
|
|
||||||
pub trait Emitter {
|
pub trait Emitter {
|
||||||
fn emit(&self,
|
fn emit(&self,
|
||||||
cmsp: Option<(@codemap::CodeMap, Span)>,
|
cmsp: Option<(&codemap::CodeMap, Span)>,
|
||||||
msg: &str,
|
msg: &str,
|
||||||
lvl: level);
|
lvl: level);
|
||||||
}
|
}
|
||||||
|
@ -36,18 +36,18 @@ pub struct SpanHandler {
|
||||||
|
|
||||||
impl SpanHandler {
|
impl SpanHandler {
|
||||||
pub fn span_fatal(@mut self, sp: Span, msg: &str) -> ! {
|
pub fn span_fatal(@mut self, sp: Span, msg: &str) -> ! {
|
||||||
self.handler.emit(Some((self.cm, sp)), msg, fatal);
|
self.handler.emit(Some((&*self.cm, sp)), msg, fatal);
|
||||||
fail!();
|
fail!();
|
||||||
}
|
}
|
||||||
pub fn span_err(@mut self, sp: Span, msg: &str) {
|
pub fn span_err(@mut self, sp: Span, msg: &str) {
|
||||||
self.handler.emit(Some((self.cm, sp)), msg, error);
|
self.handler.emit(Some((&*self.cm, sp)), msg, error);
|
||||||
self.handler.bump_err_count();
|
self.handler.bump_err_count();
|
||||||
}
|
}
|
||||||
pub fn span_warn(@mut self, sp: Span, msg: &str) {
|
pub fn span_warn(@mut self, sp: Span, msg: &str) {
|
||||||
self.handler.emit(Some((self.cm, sp)), msg, warning);
|
self.handler.emit(Some((&*self.cm, sp)), msg, warning);
|
||||||
}
|
}
|
||||||
pub fn span_note(@mut self, sp: Span, msg: &str) {
|
pub fn span_note(@mut self, sp: Span, msg: &str) {
|
||||||
self.handler.emit(Some((self.cm, sp)), msg, note);
|
self.handler.emit(Some((&*self.cm, sp)), msg, note);
|
||||||
}
|
}
|
||||||
pub fn span_bug(@mut self, sp: Span, msg: &str) -> ! {
|
pub fn span_bug(@mut self, sp: Span, msg: &str) -> ! {
|
||||||
self.span_fatal(sp, ice_msg(msg));
|
self.span_fatal(sp, ice_msg(msg));
|
||||||
|
@ -111,7 +111,7 @@ impl Handler {
|
||||||
self.bug(~"unimplemented " + msg);
|
self.bug(~"unimplemented " + msg);
|
||||||
}
|
}
|
||||||
pub fn emit(@mut self,
|
pub fn emit(@mut self,
|
||||||
cmsp: Option<(@codemap::CodeMap, Span)>,
|
cmsp: Option<(&codemap::CodeMap, Span)>,
|
||||||
msg: &str,
|
msg: &str,
|
||||||
lvl: level) {
|
lvl: level) {
|
||||||
self.emit.emit(cmsp, msg, lvl);
|
self.emit.emit(cmsp, msg, lvl);
|
||||||
|
@ -227,7 +227,7 @@ pub struct DefaultEmitter;
|
||||||
|
|
||||||
impl Emitter for DefaultEmitter {
|
impl Emitter for DefaultEmitter {
|
||||||
fn emit(&self,
|
fn emit(&self,
|
||||||
cmsp: Option<(@codemap::CodeMap, Span)>,
|
cmsp: Option<(&codemap::CodeMap, Span)>,
|
||||||
msg: &str,
|
msg: &str,
|
||||||
lvl: level) {
|
lvl: level) {
|
||||||
match cmsp {
|
match cmsp {
|
||||||
|
@ -244,10 +244,10 @@ impl Emitter for DefaultEmitter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn highlight_lines(cm: @codemap::CodeMap,
|
fn highlight_lines(cm: &codemap::CodeMap,
|
||||||
sp: Span,
|
sp: Span,
|
||||||
lvl: level,
|
lvl: level,
|
||||||
lines: @codemap::FileLines) {
|
lines: &codemap::FileLines) {
|
||||||
let fm = lines.file;
|
let fm = lines.file;
|
||||||
let mut err = io::stderr();
|
let mut err = io::stderr();
|
||||||
let err = &mut err as &mut io::Writer;
|
let err = &mut err as &mut io::Writer;
|
||||||
|
@ -255,9 +255,9 @@ fn highlight_lines(cm: @codemap::CodeMap,
|
||||||
// arbitrarily only print up to six lines of the error
|
// arbitrarily only print up to six lines of the error
|
||||||
let max_lines = 6u;
|
let max_lines = 6u;
|
||||||
let mut elided = false;
|
let mut elided = false;
|
||||||
let mut display_lines = /* FIXME (#2543) */ lines.lines.clone();
|
let mut display_lines = lines.lines.as_slice();
|
||||||
if display_lines.len() > max_lines {
|
if display_lines.len() > max_lines {
|
||||||
display_lines = display_lines.slice(0u, max_lines).to_owned();
|
display_lines = display_lines.slice(0u, max_lines);
|
||||||
elided = true;
|
elided = true;
|
||||||
}
|
}
|
||||||
// Print the offending lines
|
// Print the offending lines
|
||||||
|
@ -311,7 +311,7 @@ fn highlight_lines(cm: @codemap::CodeMap,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_macro_backtrace(cm: @codemap::CodeMap, sp: Span) {
|
fn print_macro_backtrace(cm: &codemap::CodeMap, sp: Span) {
|
||||||
for ei in sp.expn_info.iter() {
|
for ei in sp.expn_info.iter() {
|
||||||
let ss = ei.callee.span.as_ref().map_default(~"", |span| cm.span_to_str(*span));
|
let ss = ei.callee.span.as_ref().map_default(~"", |span| cm.span_to_str(*span));
|
||||||
let (pre, post) = match ei.callee.format {
|
let (pre, post) = match ei.callee.format {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue