diff options
| author | Matthew Kelly <matthew.kelly2@gmail.com> | 2022-09-26 19:59:52 -0400 |
|---|---|---|
| committer | Matthew Kelly <matthew.kelly2@gmail.com> | 2022-09-26 19:59:52 -0400 |
| commit | 24aab524cbafec7ff8c7cd54ba4f6fb18216c623 (patch) | |
| tree | b0fd92c686ed3fe2b3a5a010c0dc32a6a54d3ea1 /compiler/rustc_monomorphize/src/errors.rs | |
| parent | eda2a401457ba645a32bdc5b9e7e90214e3e4e24 (diff) | |
| parent | 8b705839cd656d202e920efa8769cbe43a5ee269 (diff) | |
Merge remote-tracking branch 'origin/master' into mpk/add-long-error-message-for-E0311
Diffstat (limited to 'compiler/rustc_monomorphize/src/errors.rs')
| -rw-r--r-- | compiler/rustc_monomorphize/src/errors.rs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/compiler/rustc_monomorphize/src/errors.rs b/compiler/rustc_monomorphize/src/errors.rs index 77b6cfa1f69..cf6e18c013b 100644 --- a/compiler/rustc_monomorphize/src/errors.rs +++ b/compiler/rustc_monomorphize/src/errors.rs @@ -1,11 +1,11 @@ use std::path::PathBuf; use rustc_errors::ErrorGuaranteed; -use rustc_macros::{LintDiagnostic, SessionDiagnostic}; -use rustc_session::SessionDiagnostic; +use rustc_errors::IntoDiagnostic; +use rustc_macros::{Diagnostic, LintDiagnostic}; use rustc_span::Span; -#[derive(SessionDiagnostic)] +#[derive(Diagnostic)] #[diag(monomorphize::recursion_limit)] pub struct RecursionLimit { #[primary_span] @@ -19,7 +19,7 @@ pub struct RecursionLimit { pub path: PathBuf, } -#[derive(SessionDiagnostic)] +#[derive(Diagnostic)] #[diag(monomorphize::type_length_limit)] #[help(monomorphize::consider_type_length_limit)] pub struct TypeLengthLimit { @@ -32,7 +32,7 @@ pub struct TypeLengthLimit { pub type_length: usize, } -#[derive(SessionDiagnostic)] +#[derive(Diagnostic)] #[diag(monomorphize::requires_lang_item)] pub struct RequiresLangItem { pub lang_item: String, @@ -44,12 +44,13 @@ pub struct UnusedGenericParams { pub param_names: Vec<String>, } -impl SessionDiagnostic<'_> for UnusedGenericParams { +impl IntoDiagnostic<'_> for UnusedGenericParams { fn into_diagnostic( self, - sess: &'_ rustc_session::parse::ParseSess, + handler: &'_ rustc_errors::Handler, ) -> rustc_errors::DiagnosticBuilder<'_, ErrorGuaranteed> { - let mut diag = sess.struct_err(rustc_errors::fluent::monomorphize::unused_generic_params); + let mut diag = + handler.struct_err(rustc_errors::fluent::monomorphize::unused_generic_params); diag.set_span(self.span); for (span, name) in self.param_spans.into_iter().zip(self.param_names) { // FIXME: I can figure out how to do a label with a fluent string with a fixed message, @@ -71,11 +72,11 @@ pub struct LargeAssignmentsLint { pub limit: u64, } -#[derive(SessionDiagnostic)] +#[derive(Diagnostic)] #[diag(monomorphize::unknown_partition_strategy)] pub struct UnknownPartitionStrategy; -#[derive(SessionDiagnostic)] +#[derive(Diagnostic)] #[diag(monomorphize::symbol_already_defined)] pub struct SymbolAlreadyDefined { #[primary_span] |
