diff options
| author | bors <bors@rust-lang.org> | 2022-11-06 11:23:24 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-11-06 11:23:24 +0000 |
| commit | 534ddc6166a9031b0c269544929d68f2539ea7a0 (patch) | |
| tree | 890271f3baa8fdd2af21d78b879e9c2b52b29bd5 /compiler | |
| parent | 88935e0beacb49bb552de1628bdf50b183f7b926 (diff) | |
| parent | 3b6b6047b6d60879c589b4ad52badfc5752624ac (diff) | |
| download | rust-534ddc6166a9031b0c269544929d68f2539ea7a0.tar.gz rust-534ddc6166a9031b0c269544929d68f2539ea7a0.zip | |
Auto merge of #103720 - crlf0710:most_translation_attr, r=compiler-errors
Lint against usages of `struct_span_lint_hir`. r? `@compiler-errors`
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_middle/src/ty/context.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_passes/src/lib.rs | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index e039436fe0a..fc706b890d5 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -2813,7 +2813,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) }) } @@ -2823,6 +2825,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, diff --git a/compiler/rustc_passes/src/lib.rs b/compiler/rustc_passes/src/lib.rs index 15f60f626c8..6e621b7eb5e 100644 --- a/compiler/rustc_passes/src/lib.rs +++ b/compiler/rustc_passes/src/lib.rs @@ -5,8 +5,6 @@ //! This API is completely unstable and subject to change. #![allow(rustc::potential_query_instability)] -#![deny(rustc::untranslatable_diagnostic)] -#![deny(rustc::diagnostic_outside_of_impl)] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(iter_intersperse)] #![feature(let_chains)] |
