non_local_defs: indicate that the macro needs to change
aaa
This commit is contained in:
parent
5870f1ccbb
commit
c4c8bda689
5 changed files with 19 additions and 0 deletions
|
@ -1355,6 +1355,7 @@ pub enum NonLocalDefinitionsDiag {
|
|||
has_trait: bool,
|
||||
self_ty_str: String,
|
||||
of_trait_str: Option<String>,
|
||||
macro_to_change: Option<(String, &'static str)>,
|
||||
},
|
||||
MacroRules {
|
||||
depth: u32,
|
||||
|
@ -1380,6 +1381,7 @@ impl<'a> LintDiagnostic<'a, ()> for NonLocalDefinitionsDiag {
|
|||
has_trait,
|
||||
self_ty_str,
|
||||
of_trait_str,
|
||||
macro_to_change,
|
||||
} => {
|
||||
diag.primary_message(fluent::lint_non_local_definitions_impl);
|
||||
diag.arg("depth", depth);
|
||||
|
@ -1390,6 +1392,12 @@ impl<'a> LintDiagnostic<'a, ()> for NonLocalDefinitionsDiag {
|
|||
diag.arg("of_trait_str", of_trait_str);
|
||||
}
|
||||
|
||||
if let Some((macro_to_change, macro_kind)) = macro_to_change {
|
||||
diag.arg("macro_to_change", macro_to_change);
|
||||
diag.arg("macro_kind", macro_kind);
|
||||
diag.note(fluent::lint_macro_to_change);
|
||||
}
|
||||
|
||||
if has_trait {
|
||||
diag.note(fluent::lint_bounds);
|
||||
diag.note(fluent::lint_with_trait);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue