Skip to content

Commit 534ddc6

Browse files
committed
Auto merge of #103720 - crlf0710:most_translation_attr, r=compiler-errors
Lint against usages of `struct_span_lint_hir`. r? `@compiler-errors`
2 parents 88935e0 + 3b6b604 commit 534ddc6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

compiler/rustc_middle/src/ty/context.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -2813,7 +2813,9 @@ impl<'tcx> TyCtxt<'tcx> {
28132813
span: impl Into<MultiSpan>,
28142814
decorator: impl for<'a> DecorateLint<'a, ()>,
28152815
) {
2816-
self.struct_span_lint_hir(lint, hir_id, span, decorator.msg(), |diag| {
2816+
let msg = decorator.msg();
2817+
let (level, src) = self.lint_level_at_node(lint, hir_id);
2818+
struct_lint_level(self.sess, lint, level, src, Some(span.into()), msg, |diag| {
28172819
decorator.decorate_lint(diag)
28182820
})
28192821
}
@@ -2823,6 +2825,7 @@ impl<'tcx> TyCtxt<'tcx> {
28232825
/// Return value of the `decorate` closure is ignored, see [`struct_lint_level`] for a detailed explanation.
28242826
///
28252827
/// [`struct_lint_level`]: rustc_middle::lint::struct_lint_level#decorate-signature
2828+
#[rustc_lint_diagnostics]
28262829
pub fn struct_span_lint_hir(
28272830
self,
28282831
lint: &'static Lint,

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)