]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_lint/src/context.rs
add: `#[rustc_lint_diagnostics]` for more `context.rs` functions.
[rust.git] / compiler / rustc_lint / src / context.rs
index a16bb7f1a5f47aaaf3e1b5105c3e16c3090c1866..de9e71d26e17f63a920fa2bad6f6e14b814f5833 100644 (file)
@@ -13,6 +13,8 @@
 //! previous lint state is pushed onto a stack and the ast is then recursed
 //! upon. As the ast is traversed, this keeps track of the current lint level
 //! for all lint attributes.
+#![deny(rustc::untranslatable_diagnostic)]
+#![deny(rustc::diagnostic_outside_of_impl)]
 
 use self::TargetLint::*;
 
@@ -965,6 +967,7 @@ fn lint(
     /// Note that this function should only be called for [`LintExpectationId`]s
     /// retrieved from the current lint pass. Buffered or manually created ids can
     /// cause ICEs.
+    #[rustc_lint_diagnostics]
     fn fulfill_expectation(&self, expectation: LintExpectationId) {
         // We need to make sure that submitted expectation ids are correctly fulfilled suppressed
         // and stored between compilation sessions. To not manually do these steps, we simply create
@@ -1011,6 +1014,7 @@ fn lints(&self) -> &LintStore {
         &*self.lint_store
     }
 
+    #[rustc_lint_diagnostics]
     fn lookup<S: Into<MultiSpan>>(
         &self,
         lint: &'static Lint,
@@ -1045,6 +1049,7 @@ fn lints(&self) -> &LintStore {
         self.builder.lint_store()
     }
 
+    #[rustc_lint_diagnostics]
     fn lookup<S: Into<MultiSpan>>(
         &self,
         lint: &'static Lint,