diff options
| author | Michael Goulet <michael@errs.io> | 2022-08-28 01:08:24 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-08-28 01:08:24 +0000 |
| commit | 18b640aee5b5435491a9db82c08c8fde8b7b62c9 (patch) | |
| tree | cbb091caffb0e8320c006ba446598c395afebdd4 /compiler/rustc_errors/src | |
| parent | 2f78dd15a6f29894e5876582cc84e8a5faa539c1 (diff) | |
| download | rust-18b640aee5b5435491a9db82c08c8fde8b7b62c9.tar.gz rust-18b640aee5b5435491a9db82c08c8fde8b7b62c9.zip | |
Suggest calling when operator types mismatch
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 9b9c334d4df..b21e9c2c96c 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -1248,9 +1248,13 @@ impl HandlerInner { } fn treat_err_as_bug(&self) -> bool { - self.flags - .treat_err_as_bug - .map_or(false, |c| self.err_count() + self.lint_err_count >= c.get()) + self.flags.treat_err_as_bug.map_or(false, |c| { + self.err_count() + + self.lint_err_count + + self.delayed_span_bugs.len() + + self.delayed_good_path_bugs.len() + >= c.get() + }) } fn print_error_count(&mut self, registry: &Registry) { @@ -1406,7 +1410,14 @@ impl HandlerInner { // This is technically `self.treat_err_as_bug()` but `delay_span_bug` is called before // incrementing `err_count` by one, so we need to +1 the comparing. // FIXME: Would be nice to increment err_count in a more coherent way. - if self.flags.treat_err_as_bug.map_or(false, |c| self.err_count() + 1 >= c.get()) { + if self.flags.treat_err_as_bug.map_or(false, |c| { + self.err_count() + + self.lint_err_count + + self.delayed_span_bugs.len() + + self.delayed_good_path_bugs.len() + + 1 + >= c.get() + }) { // FIXME: don't abort here if report_delayed_bugs is off self.span_bug(sp, msg); } |
