Skip to content

Commit ce72f94

Browse files
committed
add: #[rustc_lint_diagnostics] for more context.rs functions.
1 parent 78fce79 commit ce72f94

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_lint/src/context.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
//! previous lint state is pushed onto a stack and the ast is then recursed
1414
//! upon. As the ast is traversed, this keeps track of the current lint level
1515
//! for all lint attributes.
16+
#![deny(rustc::untranslatable_diagnostic)]
17+
#![deny(rustc::diagnostic_outside_of_impl)]
1618

1719
use self::TargetLint::*;
1820

@@ -965,6 +967,7 @@ pub trait LintContext: Sized {
965967
/// Note that this function should only be called for [`LintExpectationId`]s
966968
/// retrieved from the current lint pass. Buffered or manually created ids can
967969
/// cause ICEs.
970+
#[rustc_lint_diagnostics]
968971
fn fulfill_expectation(&self, expectation: LintExpectationId) {
969972
// We need to make sure that submitted expectation ids are correctly fulfilled suppressed
970973
// and stored between compilation sessions. To not manually do these steps, we simply create
@@ -1011,6 +1014,7 @@ impl<'tcx> LintContext for LateContext<'tcx> {
10111014
&*self.lint_store
10121015
}
10131016

1017+
#[rustc_lint_diagnostics]
10141018
fn lookup<S: Into<MultiSpan>>(
10151019
&self,
10161020
lint: &'static Lint,
@@ -1045,6 +1049,7 @@ impl LintContext for EarlyContext<'_> {
10451049
self.builder.lint_store()
10461050
}
10471051

1052+
#[rustc_lint_diagnostics]
10481053
fn lookup<S: Into<MultiSpan>>(
10491054
&self,
10501055
lint: &'static Lint,

0 commit comments

Comments
 (0)