#[diagnostic::on_unimplemented]
without filters
This commit adds support for a `#[diagnostic::on_unimplemented]` attribute with the following options: * `message` to customize the primary error message * `note` to add a customized note message to an error message * `label` to customize the label part of the error message Co-authored-by: León Orell Valerian Liehr <me@fmease.dev> Co-authored-by: Michael Goulet <michael@errs.io>
This commit is contained in:
parent
e5fedceabf
commit
5b8a7a0917
18 changed files with 360 additions and 39 deletions
|
@ -3404,8 +3404,8 @@ declare_lint_pass! {
|
|||
UNFULFILLED_LINT_EXPECTATIONS,
|
||||
UNINHABITED_STATIC,
|
||||
UNKNOWN_CRATE_TYPES,
|
||||
UNKNOWN_DIAGNOSTIC_ATTRIBUTES,
|
||||
UNKNOWN_LINTS,
|
||||
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
|
||||
UNNAMEABLE_TEST_ITEMS,
|
||||
UNNAMEABLE_TYPES,
|
||||
UNREACHABLE_CODE,
|
||||
|
@ -4419,7 +4419,8 @@ declare_lint! {
|
|||
}
|
||||
|
||||
declare_lint! {
|
||||
/// The `unknown_diagnostic_attributes` lint detects unrecognized diagnostic attributes.
|
||||
/// The `unknown_or_malformed_diagnostic_attributes` lint detects unrecognized or otherwise malformed
|
||||
/// diagnostic attributes.
|
||||
///
|
||||
/// ### Example
|
||||
///
|
||||
|
@ -4431,15 +4432,17 @@ declare_lint! {
|
|||
///
|
||||
/// {{produces}}
|
||||
///
|
||||
///
|
||||
/// ### Explanation
|
||||
///
|
||||
/// It is usually a mistake to specify a diagnostic attribute that does not exist. Check
|
||||
/// the spelling, and check the diagnostic attribute listing for the correct name. Also
|
||||
/// consider if you are using an old version of the compiler, and the attribute
|
||||
/// is only available in a newer version.
|
||||
pub UNKNOWN_DIAGNOSTIC_ATTRIBUTES,
|
||||
pub UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
|
||||
Warn,
|
||||
"unrecognized diagnostic attribute"
|
||||
"unrecognized or malformed diagnostic attribute",
|
||||
@feature_gate = sym::diagnostic_namespace;
|
||||
}
|
||||
|
||||
declare_lint! {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue