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>
|
pub fn track_errors<F, T>(&self, f: F) -> Result<T, usize>
|
||||||
where F: FnOnce() -> T
|
where F: FnOnce() -> T
|
||||||
{
|
{
|
||||||
let mut count = self.err_count();
|
let count = self.err_count();
|
||||||
let result = f();
|
let result = f();
|
||||||
count -= self.err_count();
|
let count = self.err_count() - count;
|
||||||
if count == 0 {
|
if count == 0 {
|
||||||
Ok(result)
|
Ok(result)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue