We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e3e57c commit cba77ffCopy full SHA for cba77ff
src/libsyntax/diagnostic.rs
@@ -86,11 +86,14 @@ impl codemap_handler of handler for handler_t {
86
}
87
fn has_errors() -> bool { self.err_count > 0u }
88
fn abort_if_errors() {
89
- if self.err_count > 0u {
90
- let s = #fmt["aborting due to %u previous errors",
91
- self.err_count];
92
- self.fatal(s);
+ let s;
+ alt self.err_count {
+ 0u { ret; }
+ 1u { s = "aborting due to previous error"; }
93
+ _ { s = #fmt["aborting due to %u previous errors",
94
+ self.err_count]; }
95
96
+ self.fatal(s);
97
98
fn warn(msg: str) {
99
self.emit(none, msg, warning);
0 commit comments