diff options
| author | Rejyr <jerrylwang123@gmail.com> | 2022-11-10 21:01:45 -0500 |
|---|---|---|
| committer | Rejyr <jerrylwang123@gmail.com> | 2023-01-09 17:07:25 -0500 |
| commit | ce72f942d7a9ba564332dd8b6afba05799f1f45e (patch) | |
| tree | 76012bcf30c176731d6f20653033a05c84be4dc6 | |
| parent | 78fce795d8084e288278270438a49df6172dd36c (diff) | |
| download | rust-ce72f942d7a9ba564332dd8b6afba05799f1f45e.tar.gz rust-ce72f942d7a9ba564332dd8b6afba05799f1f45e.zip | |
add: `#[rustc_lint_diagnostics]` for more `context.rs` functions.
| -rw-r--r-- | compiler/rustc_lint/src/context.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_lint/src/context.rs b/compiler/rustc_lint/src/context.rs index a16bb7f1a5f..de9e71d26e1 100644 --- a/compiler/rustc_lint/src/context.rs +++ b/compiler/rustc_lint/src/context.rs @@ -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 @@ pub trait LintContext: Sized { /// 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 @@ impl<'tcx> LintContext for LateContext<'tcx> { &*self.lint_store } + #[rustc_lint_diagnostics] fn lookup<S: Into<MultiSpan>>( &self, lint: &'static Lint, @@ -1045,6 +1049,7 @@ impl LintContext for EarlyContext<'_> { self.builder.lint_store() } + #[rustc_lint_diagnostics] fn lookup<S: Into<MultiSpan>>( &self, lint: &'static Lint, |
