Skip to content

Commit 3b6b604

Browse files
committed
Lint against usages of struct_span_lint_hir.
1 parent 33b55ac commit 3b6b604

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Diff for: compiler/rustc_middle/src/ty/context.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -2819,7 +2819,9 @@ impl<'tcx> TyCtxt<'tcx> {
28192819
span: impl Into<MultiSpan>,
28202820
decorator: impl for<'a> DecorateLint<'a, ()>,
28212821
) {
2822-
self.struct_span_lint_hir(lint, hir_id, span, decorator.msg(), |diag| {
2822+
let msg = decorator.msg();
2823+
let (level, src) = self.lint_level_at_node(lint, hir_id);
2824+
struct_lint_level(self.sess, lint, level, src, Some(span.into()), msg, |diag| {
28232825
decorator.decorate_lint(diag)
28242826
})
28252827
}
@@ -2829,6 +2831,7 @@ impl<'tcx> TyCtxt<'tcx> {
28292831
/// Return value of the `decorate` closure is ignored, see [`struct_lint_level`] for a detailed explanation.
28302832
///
28312833
/// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature
2834+
#[rustc_lint_diagnostics]
28322835
pub fn struct_span_lint_hir(
28332836
self,
28342837
lint: &'static Lint,

Diff for: compiler/rustc_passes/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
//! This API is completely unstable and subject to change.
66
77
#![allow(rustc::potential_query_instability)]
8-
#![deny(rustc::untranslatable_diagnostic)]
9-
#![deny(rustc::diagnostic_outside_of_impl)]
108
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
119
#![feature(iter_intersperse)]
1210
#![feature(let_chains)]

0 commit comments

Comments
 (0)