Skip to content

Commit

Permalink
Reviewer requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nrc committed Jan 31, 2016
1 parent 4f97338 commit c0ac539
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ impl Session {
pub fn track_errors<F, T>(&self, f: F) -> Result<T, usize>
where F: FnOnce() -> T
{
let count = self.err_count();
let old_count = self.err_count();
let result = f();
let count = self.err_count() - count;
if count == 0 {
let errors = self.err_count() - old_count;
if errors == 0 {
Ok(result)
} else {
Err(count)
Err(errors)
}
}
pub fn span_warn<S: Into<MultiSpan>>(&self, sp: S, msg: &str) {
Expand Down

0 comments on commit c0ac539

Please sign in to comment.