We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 155126b commit 127abaaCopy full SHA for 127abaa
src/diagnostics.md
@@ -594,6 +594,20 @@ declare_lint! {
594
This makes the `ANONYMOUS_PARAMETERS` lint allow-by-default in the 2015 edition
595
but warn-by-default in the 2018 edition.
596
597
+### Feature-gated lints
598
+
599
+Lints belonging to a feature should only be usable if the feature is enabled in the
600
+crate. To support this, lint declarations can contain a feature gate like so:
601
602
+```rust,ignore
603
+declare_lint! {
604
+ pub SOME_LINT_NAME,
605
+ Warn,
606
+ "a new and useful, but feature gated lint",
607
+ @feature_gate = sym::feature_name;
608
+}
609
+```
610
611
### Future-incompatible lints
612
613
The use of the term `future-incompatible` within the compiler has a slightly
0 commit comments