about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJames Hinshelwood <jameshinshelwood1@gmail.com>2021-10-11 08:25:30 +0100
committerJames Hinshelwood <jameshinshelwood1@gmail.com>2021-10-11 08:29:41 +0100
commit857a4073b8b76bd29ff9504b5f015e5021b5d9b2 (patch)
tree62ba58d7017301b74b2f7754976bb399b663d409
parent72078faf9122e99f496f3f868d5e4ff59cfa0b00 (diff)
downloadrust-857a4073b8b76bd29ff9504b5f015e5021b5d9b2.tar.gz
rust-857a4073b8b76bd29ff9504b5f015e5021b5d9b2.zip
Add reason config example for disallowed_type
Co-authored-by: James Hinshelwood <james.hinshelwood@bigpayme.com>
-rw-r--r--clippy_lints/src/disallowed_type.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/clippy_lints/src/disallowed_type.rs b/clippy_lints/src/disallowed_type.rs
index 261e9af11c8..8113c388018 100644
--- a/clippy_lints/src/disallowed_type.rs
+++ b/clippy_lints/src/disallowed_type.rs
@@ -21,7 +21,15 @@ declare_clippy_lint! {
     /// An example clippy.toml configuration:
     /// ```toml
     /// # clippy.toml
-    /// disallowed-types = ["std::collections::BTreeMap"]
+    /// disallowed-types = [
+    ///     # Can use a string as the path of the disallowed type.
+    ///     "std::collections::BTreeMap",
+    ///     # Can also use an inline table with a `path` key.
+    ///     { path = "std::net::TcpListener" },
+    ///     # When using an inline table, can add a `reason` for why the type
+    ///     # is disallowed.
+    ///     { path = "std::net::Ipv4Addr", reason = "no IPv4 allowed" },
+    /// ]
     /// ```
     ///
     /// ```rust,ignore