about summary refs log tree commit diff
path: root/compiler/rustc_session/src/errors.rs
diff options
context:
space:
mode:
authorLuis Cardoso <61982523+LuisCardosoOliveira@users.noreply.github.com>2022-09-05 07:58:05 +0200
committerLuis Cardoso <61982523+LuisCardosoOliveira@users.noreply.github.com>2022-09-08 08:30:57 +0200
commit24de9435e2d4efe2bde043f389579a72fb532c6f (patch)
tree3f1607f9011bed186b4f38f645844f69e569c930 /compiler/rustc_session/src/errors.rs
parent0f06320c2491acc8cf9e61c976041785acb06aca (diff)
downloadrust-24de9435e2d4efe2bde043f389579a72fb532c6f.tar.gz
rust-24de9435e2d4efe2bde043f389579a72fb532c6f.zip
translations(rustc_session): remove lint allow rule to the methods marked with rustc_lint_diagnostic
This commit removes the allows rules for the SessionDiagnostic lint
that were being used in the session.rs file.

Thanks to the PR #101230 we do not need to annotate the methods with
the allow rule as they are part of the diagnostic machinery.
Diffstat (limited to 'compiler/rustc_session/src/errors.rs')
-rw-r--r--compiler/rustc_session/src/errors.rs15
1 files changed, 5 insertions, 10 deletions
diff --git a/compiler/rustc_session/src/errors.rs b/compiler/rustc_session/src/errors.rs
index 226e0958927..a4e13e22ae2 100644
--- a/compiler/rustc_session/src/errors.rs
+++ b/compiler/rustc_session/src/errors.rs
@@ -1,9 +1,8 @@
 use std::num::NonZeroU32;
 
 use crate::cgu_reuse_tracker::CguReuse;
-use crate::parse::ParseSess;
-use crate::{self as rustc_session};
-use rustc_errors::{fluent, MultiSpan};
+use crate::{self as rustc_session, SessionDiagnostic};
+use rustc_errors::{fluent, DiagnosticBuilder, Handler, MultiSpan};
 use rustc_macros::SessionDiagnostic;
 use rustc_span::{Span, Symbol};
 use rustc_target::abi::TargetDataLayoutErrors;
@@ -46,14 +45,10 @@ pub struct FeatureDiagnosticHelp {
     pub feature: Symbol,
 }
 
-pub struct TargetDataLayoutParseError<'a> {
-    pub err: TargetDataLayoutErrors<'a>,
-}
-
-impl crate::SessionDiagnostic<'_, !> for TargetDataLayoutParseError<'_> {
-    fn into_diagnostic(self, sess: &ParseSess) -> rustc_errors::DiagnosticBuilder<'_, !> {
+impl SessionDiagnostic<'_, !> for TargetDataLayoutErrors<'_> {
+    fn into_diagnostic(self, sess: &Handler) -> DiagnosticBuilder<'_, !> {
         let mut diag;
-        match self.err {
+        match self {
             TargetDataLayoutErrors::InvalidAddressSpace { addr_space, err, cause } => {
                 diag = sess.struct_fatal(fluent::session::target_invalid_address_space);
                 diag.set_arg("addr_space", addr_space);