diff options
| author | bors <bors@rust-lang.org> | 2017-05-21 01:53:20 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-05-21 01:53:20 +0000 |
| commit | 7ac844ffb850a73b98cd47cbdec909d1f03c7987 (patch) | |
| tree | 45c04ee9ee8bea15018df1fc3ad800e05c057341 /src/librustc_errors | |
| parent | 92ee08ad1c1cbd0aa6e7b9a3f8295081439403fa (diff) | |
| parent | 382c0eb810b9cd9f1e944df629f14a2dae0b13f4 (diff) | |
| download | rust-7ac844ffb850a73b98cd47cbdec909d1f03c7987.tar.gz rust-7ac844ffb850a73b98cd47cbdec909d1f03c7987.zip | |
Auto merge of #42130 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 6 pull requests - Successful merges: #41892, #42062, #42091, #42093, #42098, #42127 - Failed merges:
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/diagnostic_builder.rs | 4 | ||||
| -rw-r--r-- | src/librustc_errors/emitter.rs | 6 | ||||
| -rw-r--r-- | src/librustc_errors/lib.rs | 4 |
3 files changed, 6 insertions, 8 deletions
diff --git a/src/librustc_errors/diagnostic_builder.rs b/src/librustc_errors/diagnostic_builder.rs index fc5fd44f091..0081339a363 100644 --- a/src/librustc_errors/diagnostic_builder.rs +++ b/src/librustc_errors/diagnostic_builder.rs @@ -192,8 +192,8 @@ impl<'a> Debug for DiagnosticBuilder<'a> { } } -/// Destructor bomb - a DiagnosticBuilder must be either emitted or cancelled or -/// we emit a bug. +/// Destructor bomb - a `DiagnosticBuilder` must be either emitted or cancelled +/// or we emit a bug. impl<'a> Drop for DiagnosticBuilder<'a> { fn drop(&mut self) { if !panicking() && !self.cancelled() { diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index 03f1b94b169..a9645f9ab7b 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -1296,10 +1296,8 @@ impl Write for BufferedWriter { } fn flush(&mut self) -> io::Result<()> { let mut stderr = io::stderr(); - let result = (|| { - stderr.write_all(&self.buffer)?; - stderr.flush() - })(); + let result = stderr.write_all(&self.buffer) + .and_then(|_| stderr.flush()); self.buffer.clear(); result } diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 7a561e3a970..c91dc9d8797 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -383,7 +383,7 @@ impl Handler { pub fn span_fatal<S: Into<MultiSpan>>(&self, sp: S, msg: &str) -> FatalError { self.emit(&sp.into(), msg, Fatal); self.panic_if_treat_err_as_bug(); - return FatalError; + FatalError } pub fn span_fatal_with_code<S: Into<MultiSpan>>(&self, sp: S, @@ -392,7 +392,7 @@ impl Handler { -> FatalError { self.emit_with_code(&sp.into(), msg, code, Fatal); self.panic_if_treat_err_as_bug(); - return FatalError; + FatalError } pub fn span_err<S: Into<MultiSpan>>(&self, sp: S, msg: &str) { self.emit(&sp.into(), msg, Error); |
