-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Lint messages don't always explain the error in much detail, and so would often benefit from a detailed --explain
explanation just like normal errors, e.g. this will hit a dead_code warning, but that doesn't really help diagnose the problem (that mod foo;
is private), a detailed explanation could include discussion of the privacy/modules aspect of the lint.
#![crate_type = "lib"]
mod foo;
// foo.rs
pub fn bar() {}
foo.rs:2:1: 2:12 warning: function is never used: `bar`, #[warn(dead_code)] on by default
foo.rs:2 fn bar() {}
^~~~~~~~~~~
It might also make sense to have a generic "lints" detailed explanation, that (a) lints that don't have their own error message point to, and (b) that any specific lint explanation also points to ("see also [E...] for more on lints"). This could include the common details of how the allow
/etc. attributes work.
On the other hand, lints may change too fast for this to make sense.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.