Skip to content

Commit 552bf75

Browse files
committed
Auto merge of #31257 - tmiasko:track-errors-fix, r=nikomatsakis
r? @nrc
2 parents 10de882 + b3e30b5 commit 552bf75

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc/session/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ impl Session {
179179
pub fn track_errors<F, T>(&self, f: F) -> Result<T, usize>
180180
where F: FnOnce() -> T
181181
{
182-
let mut count = self.err_count();
182+
let count = self.err_count();
183183
let result = f();
184-
count -= self.err_count();
184+
let count = self.err_count() - count;
185185
if count == 0 {
186186
Ok(result)
187187
} else {

0 commit comments

Comments
 (0)