diff options
| author | bors <bors@rust-lang.org> | 2021-01-15 09:27:21 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-01-15 09:27:21 +0000 |
| commit | 4e208f6a3afb42528878b0f3464e337c4bf3bbc8 (patch) | |
| tree | 21529ff86f6f364980511a8cb4cb7a0001ae29c0 /compiler/rustc_errors/src/lib.rs | |
| parent | dcf622eb70aebe16d40c5f88fa2a41fa7019541c (diff) | |
| parent | 7286be15fa3f18ea4bd5b6ce481426f7d78e4a57 (diff) | |
| download | rust-4e208f6a3afb42528878b0f3464e337c4bf3bbc8.tar.gz rust-4e208f6a3afb42528878b0f3464e337c4bf3bbc8.zip | |
Auto merge of #81035 - JohnTitor:rollup-9m03awf, r=JohnTitor
Rollup of 5 pull requests
Successful merges:
- #80254 (Don't try to add nested predicate to Rustdoc auto-trait `ParamEnv`)
- #80834 (Remove unreachable panics from VecDeque::{front/back}[_mut])
- #80944 (Use Option::map_or instead of `.map(..).unwrap_or(..)`)
- #81008 (Don't ICE when computing a layout of a generator tainted by errors)
- #81023 (Remove doctree::Variant)
Failed merges:
- #81033 (Remove useless `clean::Variant` struct)
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_errors/src/lib.rs')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 593e0d92031..e184e929b07 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -804,7 +804,7 @@ impl HandlerInner { } fn treat_err_as_bug(&self) -> bool { - self.flags.treat_err_as_bug.map(|c| self.err_count() >= c).unwrap_or(false) + self.flags.treat_err_as_bug.map_or(false, |c| self.err_count() >= c) } fn print_error_count(&mut self, registry: &Registry) { @@ -913,7 +913,7 @@ 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(|c| self.err_count() + 1 >= c).unwrap_or(false) { + if self.flags.treat_err_as_bug.map_or(false, |c| self.err_count() + 1 >= c) { // FIXME: don't abort here if report_delayed_bugs is off self.span_bug(sp, msg); } |
