Auto merge of #31257 - tmiasko:track-errors-fix, r=nikomatsakis
r? @nrc
This commit is contained in:
commit
552bf75e7d
1 changed files with 2 additions and 2 deletions
|
@ -179,9 +179,9 @@ impl Session {
|
|||
pub fn track_errors<F, T>(&self, f: F) -> Result<T, usize>
|
||||
where F: FnOnce() -> T
|
||||
{
|
||||
let mut count = self.err_count();
|
||||
let count = self.err_count();
|
||||
let result = f();
|
||||
count -= self.err_count();
|
||||
let count = self.err_count() - count;
|
||||
if count == 0 {
|
||||
Ok(result)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue