diff options
| author | bors <bors@rust-lang.org> | 2022-10-23 09:06:39 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-10-23 09:06:39 +0000 |
| commit | e64f1110c062f61746f222059439529a43ccf6dc (patch) | |
| tree | f6deb949a3796b6fd79eef0a3745e2d9dcc1ae8c /compiler/rustc_monomorphize/src/errors.rs | |
| parent | faab68eb29121f25b577b50e2e00e33bafc60a36 (diff) | |
| parent | 6987322445d7388b61d6249204402574ee0308f5 (diff) | |
| download | rust-e64f1110c062f61746f222059439529a43ccf6dc.tar.gz rust-e64f1110c062f61746f222059439529a43ccf6dc.zip | |
Auto merge of #103345 - Nilstrieb:diag-flat, r=compiler-errors
Flatten diagnostic slug modules This makes it easier to grep for the slugs in the code. See https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Localization.20infra.20interferes.20with.20grepping.20for.20error for more discussion about it. This was mostly done with a few regexes and a bunch of manual work. This also exposes a pretty annoying inconsistency for the extra labels. Some of the extra labels are defined as additional properties in the fluent message (which makes them not prefixed with the crate name) and some of them are new fluent messages themselves (which makes them prefixed with the crate name). I don't know whether we want to clean this up at some point but it's useful to know. r? `@davidtwco`
Diffstat (limited to 'compiler/rustc_monomorphize/src/errors.rs')
| -rw-r--r-- | compiler/rustc_monomorphize/src/errors.rs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/compiler/rustc_monomorphize/src/errors.rs b/compiler/rustc_monomorphize/src/errors.rs index cf6e18c013b..ce097b8d846 100644 --- a/compiler/rustc_monomorphize/src/errors.rs +++ b/compiler/rustc_monomorphize/src/errors.rs @@ -6,7 +6,7 @@ use rustc_macros::{Diagnostic, LintDiagnostic}; use rustc_span::Span; #[derive(Diagnostic)] -#[diag(monomorphize::recursion_limit)] +#[diag(monomorphize_recursion_limit)] pub struct RecursionLimit { #[primary_span] pub span: Span, @@ -14,26 +14,26 @@ pub struct RecursionLimit { #[note] pub def_span: Span, pub def_path_str: String, - #[note(monomorphize::written_to_path)] + #[note(monomorphize_written_to_path)] pub was_written: Option<()>, pub path: PathBuf, } #[derive(Diagnostic)] -#[diag(monomorphize::type_length_limit)] -#[help(monomorphize::consider_type_length_limit)] +#[diag(monomorphize_type_length_limit)] +#[help(monomorphize_consider_type_length_limit)] pub struct TypeLengthLimit { #[primary_span] pub span: Span, pub shrunk: String, - #[note(monomorphize::written_to_path)] + #[note(monomorphize_written_to_path)] pub was_written: Option<()>, pub path: PathBuf, pub type_length: usize, } #[derive(Diagnostic)] -#[diag(monomorphize::requires_lang_item)] +#[diag(monomorphize_requires_lang_item)] pub struct RequiresLangItem { pub lang_item: String, } @@ -49,8 +49,7 @@ impl IntoDiagnostic<'_> for UnusedGenericParams { self, handler: &'_ rustc_errors::Handler, ) -> rustc_errors::DiagnosticBuilder<'_, ErrorGuaranteed> { - let mut diag = - handler.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, @@ -63,7 +62,7 @@ impl IntoDiagnostic<'_> for UnusedGenericParams { } #[derive(LintDiagnostic)] -#[diag(monomorphize::large_assignments)] +#[diag(monomorphize_large_assignments)] #[note] pub struct LargeAssignmentsLint { #[label] @@ -73,11 +72,11 @@ pub struct LargeAssignmentsLint { } #[derive(Diagnostic)] -#[diag(monomorphize::unknown_partition_strategy)] +#[diag(monomorphize_unknown_partition_strategy)] pub struct UnknownPartitionStrategy; #[derive(Diagnostic)] -#[diag(monomorphize::symbol_already_defined)] +#[diag(monomorphize_symbol_already_defined)] pub struct SymbolAlreadyDefined { #[primary_span] pub span: Option<Span>, |
