Skip to content

Commit ae5cc9c

Browse files
committed
fix: lint against lint functions
fix: lint against the functions `LintContext::{lookup_with_diagnostics,lookup,struct_span_lint,lint}`, `TyCtxt::struct_lint_node`, `LintLevelsBuilder::struct_lint`.
1 parent 73c9eaf commit ae5cc9c

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

compiler/rustc_lint/src/context.rs

+4
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ pub trait LintContext: Sized {
579579
/// Return value of the `decorate` closure is ignored, see [`struct_lint_level`] for a detailed explanation.
580580
///
581581
/// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature
582+
#[rustc_lint_diagnostics]
582583
fn lookup_with_diagnostics(
583584
&self,
584585
lint: &'static Lint,
@@ -882,6 +883,7 @@ pub trait LintContext: Sized {
882883
/// Return value of the `decorate` closure is ignored, see [`struct_lint_level`] for a detailed explanation.
883884
///
884885
/// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature
886+
#[rustc_lint_diagnostics]
885887
fn lookup<S: Into<MultiSpan>>(
886888
&self,
887889
lint: &'static Lint,
@@ -908,6 +910,7 @@ pub trait LintContext: Sized {
908910
/// Return value of the `decorate` closure is ignored, see [`struct_lint_level`] for a detailed explanation.
909911
///
910912
/// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature
913+
#[rustc_lint_diagnostics]
911914
fn struct_span_lint<S: Into<MultiSpan>>(
912915
&self,
913916
lint: &'static Lint,
@@ -933,6 +936,7 @@ pub trait LintContext: Sized {
933936
/// Return value of the `decorate` closure is ignored, see [`struct_lint_level`] for a detailed explanation.
934937
///
935938
/// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature
939+
#[rustc_lint_diagnostics]
936940
fn lint(
937941
&self,
938942
lint: &'static Lint,

compiler/rustc_lint/src/levels.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,7 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
10731073
/// Return value of the `decorate` closure is ignored, see [`struct_lint_level`] for a detailed explanation.
10741074
///
10751075
/// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature
1076+
#[rustc_lint_diagnostics]
10761077
pub(crate) fn struct_lint(
10771078
&self,
10781079
lint: &'static Lint,

compiler/rustc_lint/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#![feature(let_chains)]
3737
#![feature(min_specialization)]
3838
#![feature(never_type)]
39+
#![feature(rustc_attrs)]
3940
#![recursion_limit = "256"]
4041

4142
#[macro_use]

compiler/rustc_middle/src/ty/context.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2856,6 +2856,7 @@ impl<'tcx> TyCtxt<'tcx> {
28562856
/// Return value of the `decorate` closure is ignored, see [`struct_lint_level`] for a detailed explanation.
28572857
///
28582858
/// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature
2859+
#[rustc_lint_diagnostics]
28592860
pub fn struct_lint_node(
28602861
self,
28612862
lint: &'static Lint,

0 commit comments

Comments
 (0)