about summary refs log tree commit diff
path: root/compiler/rustc_errors
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-09-17 10:56:42 +0000
committerbors <bors@rust-lang.org>2022-09-17 10:56:42 +0000
commit672831a5c890f51d3222511ab2575ca7a86c8e20 (patch)
treefa6f0d0797bb75d188725c2a027d8f0d6475f2c2 /compiler/rustc_errors
parentb195f5349a5f7b01369e7bba2f9fff250e62d36d (diff)
parent80cceb8f7705b9809c726cd6d8dda93451d32cc6 (diff)
downloadrust-672831a5c890f51d3222511ab2575ca7a86c8e20.tar.gz
rust-672831a5c890f51d3222511ab2575ca7a86c8e20.zip
Auto merge of #101938 - Dylan-DPC:rollup-6vlohhs, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #93628 (Stabilize `let else`)
 - #98441 (Implement simd_as for pointers)
 - #101790 (Do not suggest a placeholder to const and static without a type)
 - #101807 (Disallow defaults on type GATs)
 - #101915 (doc: fix redirected link in `/index.html`)
 - #101931 (doc: Fix a typo in `Rc::make_mut` docstring)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_errors')
-rw-r--r--compiler/rustc_errors/src/lib.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index 1b24f07e689..6f969bfcc53 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -7,7 +7,7 @@
 #![feature(if_let_guard)]
 #![feature(adt_const_params)]
 #![feature(let_chains)]
-#![feature(let_else)]
+#![cfg_attr(bootstrap, feature(let_else))]
 #![feature(never_type)]
 #![feature(result_option_inspect)]
 #![feature(rustc_attrs)]
@@ -635,6 +635,10 @@ impl Handler {
         inner.steal((span, key)).map(|diag| DiagnosticBuilder::new_diagnostic(self, diag))
     }
 
+    pub fn has_stashed_diagnostic(&self, span: Span, key: StashKey) -> bool {
+        self.inner.borrow().stashed_diagnostics.get(&(span, key)).is_some()
+    }
+
     /// Emit all stashed diagnostics.
     pub fn emit_stashed_diagnostics(&self) -> Option<ErrorGuaranteed> {
         self.inner.borrow_mut().emit_stashed_diagnostics()