diff options
| author | Tom Martin <tom.martin1239@gmail.com> | 2023-04-07 08:14:48 +0100 | 
|---|---|---|
| committer | Tom Martin <tom.martin1239@gmail.com> | 2023-04-07 08:33:56 +0100 | 
| commit | 18388c9f7372d00fa958a421b3eec639a5b7b5a2 (patch) | |
| tree | c3fd742ffab5b51e2cd9b48761f5d012c9fcca1a /compiler/rustc_resolve/src/errors.rs | |
| parent | 5c5c3c95276811d4ea72f6c4b45e7406ee8c6165 (diff) | |
| download | rust-18388c9f7372d00fa958a421b3eec639a5b7b5a2.tar.gz rust-18388c9f7372d00fa958a421b3eec639a5b7b5a2.zip | |
Rewrite added diagnostics as translatable
Start messages with lowercase
Diffstat (limited to 'compiler/rustc_resolve/src/errors.rs')
| -rw-r--r-- | compiler/rustc_resolve/src/errors.rs | 27 | 
1 files changed, 27 insertions, 0 deletions
| diff --git a/compiler/rustc_resolve/src/errors.rs b/compiler/rustc_resolve/src/errors.rs index 867363f4246..ff44ccb265a 100644 --- a/compiler/rustc_resolve/src/errors.rs +++ b/compiler/rustc_resolve/src/errors.rs @@ -472,3 +472,30 @@ pub(crate) struct Indeterminate(#[primary_span] pub(crate) Span); #[derive(Diagnostic)] #[diag(resolve_module_only)] pub(crate) struct ModuleOnly(#[primary_span] pub(crate) Span); + +#[derive(Diagnostic, Default)] +#[diag(resolve_macro_expected_found)] +pub(crate) struct MacroExpectedFound<'a> { + #[primary_span] + pub(crate) span: Span, + pub(crate) found: &'a str, + pub(crate) expected: &'a str, + pub(crate) macro_path: &'a str, + #[subdiagnostic] + pub(crate) remove_surrounding_derive: Option<RemoveSurroundingDerive>, + #[subdiagnostic] + pub(crate) remove_surrounding_derive_help: Option<RemoveAddAsNonDerive<'a>>, +} + +#[derive(Subdiagnostic)] +#[help(resolve_remove_surrounding_derive)] +pub(crate) struct RemoveSurroundingDerive { + #[primary_span] + pub(crate) span: Span, +} + +#[derive(Subdiagnostic)] +#[help(resolve_add_as_non_derive)] +pub(crate) struct RemoveAddAsNonDerive<'a> { + pub(crate) macro_path: &'a str, +} | 
