fixup! Remove requirement of fully qualified path for disallowed_method/type

This commit is contained in:
Devin Ragotzy 2021-06-13 15:52:54 -04:00
parent 70ce0c2c55
commit d4eff81282
2 changed files with 4 additions and 18 deletions

View File

@ -13,21 +13,14 @@ declare_clippy_lint! {
/// **Why is this bad?** Some methods are undesirable in certain contexts,
/// and it's beneficial to lint for them as needed.
///
/// **Known problems:** Currently, you must write each function as a
/// fully-qualified path. This lint doesn't support aliases or reexported
/// names; be aware that many types in `std` are actually reexports.
///
/// For example, if you want to disallow `Duration::as_secs`, your clippy.toml
/// configuration would look like
/// `disallowed-methods = ["core::time::Duration::as_secs"]` and not
/// `disallowed-methods = ["std::time::Duration::as_secs"]` as you might expect.
/// **Known problems:** None.
///
/// **Example:**
///
/// An example clippy.toml configuration:
/// ```toml
/// # clippy.toml
/// disallowed-methods = ["alloc::vec::Vec::leak", "std::time::Instant::now"]
/// disallowed-methods = ["std::vec::Vec::leak", "std::time::Instant::now"]
/// ```
///
/// ```rust,ignore

View File

@ -13,14 +13,7 @@ declare_clippy_lint! {
///
/// **Why is this bad?** Some types are undesirable in certain contexts.
///
/// **Known problems:** The fully qualified path must be used. This lint
/// doesn't support aliases or reexported names; be aware that many types
/// in `std` are actually reexports.
///
/// For example, if you want to disallow `BTreeMap`, your clippy.toml
/// configuration would look like
/// `disallowed-methods = ["alloc::collections::btree::map::BTreeMap"]` and not
/// `disallowed-methods = ["std::collections::BTreeMap"]` as you might expect.
/// **Known problems:** None.
///
/// N.B. There is no way to ban primitive types.
///
@ -29,7 +22,7 @@ declare_clippy_lint! {
/// An example clippy.toml configuration:
/// ```toml
/// # clippy.toml
/// disallowed-methods = ["alloc::collections::btree::map::BTreeMap"]
/// disallowed-methods = ["std::collections::BTreeMap"]
/// ```
///
/// ```rust,ignore