Skip to content

Commit a92d83a

Browse files
Rollup merge of #104132 - Rejyr:rustc_lint-function-lints, r=davidtwco
fix: lint against lint functions Add `#[rustc_lint_diagnostics]` to lint functions missing them. From [this discussion](#101138 (comment)). r? ```@davidtwco```
2 parents 3d20047 + ae5cc9c commit a92d83a

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
@@ -2872,6 +2872,7 @@ impl<'tcx> TyCtxt<'tcx> {
28722872
/// Return value of the `decorate` closure is ignored, see [`struct_lint_level`] for a detailed explanation.
28732873
///
28742874
/// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature
2875+
#[rustc_lint_diagnostics]
28752876
pub fn struct_lint_node(
28762877
self,
28772878
lint: &'static Lint,

0 commit comments

Comments
 (0)