Remove Default
derive from MacroExpectedFound
.
It's the only diagnostic in the entire project that impls `Default`, and the code is clearer without it.
This commit is contained in:
parent
af69f4c48c
commit
567744c10e
@ -521,7 +521,7 @@ pub(crate) struct ToolModuleImported {
|
|||||||
#[diag(resolve_module_only)]
|
#[diag(resolve_module_only)]
|
||||||
pub(crate) struct ModuleOnly(#[primary_span] pub(crate) Span);
|
pub(crate) struct ModuleOnly(#[primary_span] pub(crate) Span);
|
||||||
|
|
||||||
#[derive(Diagnostic, Default)]
|
#[derive(Diagnostic)]
|
||||||
#[diag(resolve_macro_expected_found)]
|
#[diag(resolve_macro_expected_found)]
|
||||||
pub(crate) struct MacroExpectedFound<'a> {
|
pub(crate) struct MacroExpectedFound<'a> {
|
||||||
#[primary_span]
|
#[primary_span]
|
||||||
|
@ -562,7 +562,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||||||
expected,
|
expected,
|
||||||
found: res.descr(),
|
found: res.descr(),
|
||||||
macro_path: &path_str,
|
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
|
// Suggest moving the macro out of the derive() if the macro isn't Derive
|
||||||
|
Loading…
x
Reference in New Issue
Block a user