Add explain_reason: false
in future_incompatible.
This allows supressing the default warning message for future incompatible ints, for lints that already provide a more detailed warning.
This commit is contained in:
parent
543ab99640
commit
7f4e343893
2 changed files with 14 additions and 3 deletions
|
@ -398,9 +398,14 @@ pub fn struct_lint_level<'s, 'd>(
|
|||
it will become a hard error in a future release!"
|
||||
.to_owned()
|
||||
};
|
||||
let citation = format!("for more information, see {}", future_incompatible.reference);
|
||||
err.warn(&explanation);
|
||||
err.note(&citation);
|
||||
if future_incompatible.explain_reason {
|
||||
err.warn(&explanation);
|
||||
}
|
||||
if !future_incompatible.reference.is_empty() {
|
||||
let citation =
|
||||
format!("for more information, see {}", future_incompatible.reference);
|
||||
err.note(&citation);
|
||||
}
|
||||
}
|
||||
|
||||
// Finally, run `decorate`. This function is also responsible for emitting the diagnostic.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue