Blacklist Method Disallowed Method (see https://github.com/rust-lang/rust-clippy/pull/5896)
What does this lint do?
Disallows certain methods, as defined in clippy.toml
Checks for method calls of specified methods
For example:
SomeStruct::bad_methodSomeTrait::bad_methodThis might take some significant overhead to implement (regex or some manual string parsing), and the main purpose would probably be to patch in temporary lints, so it might not be super useful.
# clippy.toml
disallowed-methods = ["Foo::bar", "Baz::bar"]
...
let f = Foo::default();
f.bar();
...
results in a lint
Should only the usage be blacklisted or also the definition?
We were mostly looking at usage. I can pick it up too.
Apparently we don't use the term "blacklist" anymore - #5896 . Maybe choose something else if you don't want someone to come along and rename it.
Ok I vibe with that. Would banned_method be appropriate nomenclature for the future?
The other PR used the term 'disallowed' so maybe go with disallowed_method. I probably not the right person to answer this.
Many thanks! I will go with that, then.
Most helpful comment
The other PR used the term 'disallowed' so maybe go with
disallowed_method. I probably not the right person to answer this.