diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-03-06 17:08:34 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-03-11 08:52:50 +1100 |
| commit | 567744c10ea7306d57ebee7d87d9999711de7c84 (patch) | |
| tree | d21e28aeba90bf22480d14e29be0495e87935579 | |
| parent | af69f4c48c1e1cfbb9ba43b376edcfbdd8cfbca4 (diff) | |
| download | rust-567744c10ea7306d57ebee7d87d9999711de7c84.tar.gz rust-567744c10ea7306d57ebee7d87d9999711de7c84.zip | |
Remove `Default` derive from `MacroExpectedFound`.
It's the only diagnostic in the entire project that impls `Default`, and the code is clearer without it.
| -rw-r--r-- | compiler/rustc_resolve/src/errors.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_resolve/src/macros.rs | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_resolve/src/errors.rs b/compiler/rustc_resolve/src/errors.rs index a9f5ed9908b..5eee6a51fd2 100644 --- a/compiler/rustc_resolve/src/errors.rs +++ b/compiler/rustc_resolve/src/errors.rs @@ -521,7 +521,7 @@ pub(crate) struct ToolModuleImported { #[diag(resolve_module_only)] pub(crate) struct ModuleOnly(#[primary_span] pub(crate) Span); -#[derive(Diagnostic, Default)] +#[derive(Diagnostic)] #[diag(resolve_macro_expected_found)] pub(crate) struct MacroExpectedFound<'a> { #[primary_span] diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs index c7bb2a573b1..d8fd8d22439 100644 --- a/compiler/rustc_resolve/src/macros.rs +++ b/compiler/rustc_resolve/src/macros.rs @@ -562,7 +562,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { expected, found: res.descr(), macro_path: &path_str, - ..Default::default() // Subdiagnostics default to None + remove_surrounding_derive: None, + add_as_non_derive: None, }; // Suggest moving the macro out of the derive() if the macro isn't Derive |
