From 527292a1a697c8831fc1ec01b1047ecebc10f809 Mon Sep 17 00:00:00 2001 From: Takayuki Maeda Date: Fri, 16 Sep 2022 11:24:14 +0900 Subject: do not suggest a placeholder to const and static without a type --- compiler/rustc_errors/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/rustc_errors/src') 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 { self.inner.borrow_mut().emit_stashed_diagnostics() -- cgit 1.4.1-3-g733a5