about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorDavid Wood <david.wood@huawei.com>2022-06-22 13:24:35 +0100
committerDavid Wood <david.wood@huawei.com>2022-06-27 08:32:06 +0100
commitae612241dc1f474cfa0b3a3895599c984a43caeb (patch)
tree92a4f92d4602dbd6c972c7c7d822a80af245019e /compiler/rustc_parse/src/parser
parent871c879bff903d9539c323b719d18d3b61759e62 (diff)
downloadrust-ae612241dc1f474cfa0b3a3895599c984a43caeb.tar.gz
rust-ae612241dc1f474cfa0b3a3895599c984a43caeb.zip
various: add `rustc_lint_diagnostics` to diag fns
The `rustc_lint_diagnostics` attribute is used by the diagnostic
translation/struct migration lints to identify calls where
non-translatable diagnostics or diagnostics outwith impls are being
created. Any function used in creating a diagnostic should be annotated
with this attribute so this commit adds the attribute to many more
functions.

Signed-off-by: David Wood <david.wood@huawei.com>
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/diagnostics.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs
index 58d5d43cfbf..0869ed65ad2 100644
--- a/compiler/rustc_parse/src/parser/diagnostics.rs
+++ b/compiler/rustc_parse/src/parser/diagnostics.rs
@@ -357,6 +357,7 @@ impl<'a> DerefMut for SnapshotParser<'a> {
 }
 
 impl<'a> Parser<'a> {
+    #[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
     pub(super) fn span_err<S: Into<MultiSpan>>(
         &self,
         sp: S,
@@ -365,6 +366,7 @@ impl<'a> Parser<'a> {
         err.span_err(sp, self.diagnostic())
     }
 
+    #[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
     pub fn struct_span_err<S: Into<MultiSpan>>(
         &self,
         sp: S,