about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
diff options
context:
space:
mode:
authorCharles Lew <crlf0710@gmail.com>2022-10-29 18:03:47 +0800
committerCharles Lew <crlf0710@gmail.com>2022-10-29 18:03:47 +0800
commit3b6b6047b6d60879c589b4ad52badfc5752624ac (patch)
tree960b49d3251c7d64f6c227cba74e5af4eb52ea6b /compiler/rustc_middle/src
parent33b55ac39fa633d0983fad014469e1036669bf28 (diff)
downloadrust-3b6b6047b6d60879c589b4ad52badfc5752624ac.tar.gz
rust-3b6b6047b6d60879c589b4ad52badfc5752624ac.zip
Lint against usages of `struct_span_lint_hir`.
Diffstat (limited to 'compiler/rustc_middle/src')
-rw-r--r--compiler/rustc_middle/src/ty/context.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 94e3f3b63c8..e686eeb553a 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
@@ -2819,7 +2819,9 @@ impl<'tcx> TyCtxt<'tcx> {
         span: impl Into<MultiSpan>,
         decorator: impl for<'a> DecorateLint<'a, ()>,
     ) {
-        self.struct_span_lint_hir(lint, hir_id, span, decorator.msg(), |diag| {
+        let msg = decorator.msg();
+        let (level, src) = self.lint_level_at_node(lint, hir_id);
+        struct_lint_level(self.sess, lint, level, src, Some(span.into()), msg, |diag| {
             decorator.decorate_lint(diag)
         })
     }
@@ -2829,6 +2831,7 @@ impl<'tcx> TyCtxt<'tcx> {
     /// Return value of the `decorate` closure is ignored, see [`struct_lint_level`] for a detailed explanation.
     ///
     /// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature
+    #[rustc_lint_diagnostics]
     pub fn struct_span_lint_hir(
         self,
         lint: &'static Lint,