self.handler.emit(Some((&self.cm, sp)), msg, Fatal);
panic!(FatalError);
}
+ pub fn span_fatal_with_code(&self, sp: Span, msg: &str, code: &str) -> ! {
+ self.handler.emit_with_code(Some((&self.cm, sp)), msg, code, Fatal);
+ panic!(FatalError);
+ }
pub fn span_err(&self, sp: Span, msg: &str) {
self.handler.emit(Some((&self.cm, sp)), msg, Error);
self.handler.bump_err_count();
Help,
}
-impl fmt::String for Level {
+impl fmt::Display for Level {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- use std::fmt::String;
+ use std::fmt::Display;
match *self {
Bug => "error: internal compiler error".fmt(f),
// to be miscolored. We assume this is rare enough that we don't
// have to worry about it.
if msg.ends_with("\n") {
- try!(t.write_str(&msg[..(msg.len()-1)]));
+ try!(t.write_str(&msg[..msg.len()-1]));
try!(t.reset());
try!(t.write_str("\n"));
} else {