about summary refs log tree commit diff
path: root/compiler/rustc_errors
diff options
context:
space:
mode:
authorTakayuki Maeda <takoyaki0316@gmail.com>2022-09-16 11:24:14 +0900
committerTakayuki Maeda <takoyaki0316@gmail.com>2022-09-16 11:24:14 +0900
commit527292a1a697c8831fc1ec01b1047ecebc10f809 (patch)
treebf0afe4c72b4c7fd2684d2818063472f1589c5bc /compiler/rustc_errors
parentb44197abb0b3ffe4908892e1e08ab1cd721ff3b9 (diff)
downloadrust-527292a1a697c8831fc1ec01b1047ecebc10f809.tar.gz
rust-527292a1a697c8831fc1ec01b1047ecebc10f809.zip
do not suggest a placeholder to const and static without a type
Diffstat (limited to 'compiler/rustc_errors')
-rw-r--r--compiler/rustc_errors/src/lib.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index 68abdd0bad1..d89b3da049c 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -637,6 +637,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()