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>
This commit is contained in:
parent
871c879bff
commit
ae612241dc
7 changed files with 36 additions and 2 deletions
|
@ -1077,6 +1077,7 @@ impl<'a> ExtCtxt<'a> {
|
|||
self.current_expansion.id.expansion_cause()
|
||||
}
|
||||
|
||||
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
|
||||
pub fn struct_span_err<S: Into<MultiSpan>>(
|
||||
&self,
|
||||
sp: S,
|
||||
|
@ -1101,9 +1102,11 @@ impl<'a> ExtCtxt<'a> {
|
|||
///
|
||||
/// Compilation will be stopped in the near future (at the end of
|
||||
/// the macro expansion phase).
|
||||
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
|
||||
pub fn span_err<S: Into<MultiSpan>>(&self, sp: S, msg: &str) {
|
||||
self.sess.parse_sess.span_diagnostic.span_err(sp, msg);
|
||||
}
|
||||
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
|
||||
pub fn span_warn<S: Into<MultiSpan>>(&self, sp: S, msg: &str) {
|
||||
self.sess.parse_sess.span_diagnostic.span_warn(sp, msg);
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#![feature(proc_macro_diagnostic)]
|
||||
#![feature(proc_macro_internals)]
|
||||
#![feature(proc_macro_span)]
|
||||
#![feature(rustc_attrs)]
|
||||
#![feature(try_blocks)]
|
||||
#![recursion_limit = "256"]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue