Crate to Deny Use of Functions? Does it Exist?

Hi,

I'm wondering if a tool already exists to deny the use of specific functions, macros, trait methods, and/or methods within a crate or source file. Specifically, my goal is broader than just clippy::todo or clippy::unimplemented. I'd like to make sure certain utilities I sometimes use for quick debugging or diagnostics aren't part of code when I publish it as part of CI, but because of my benchmarks, unittesting, etc., I can't just use similar substring searching.

An example of this is panic!, println!, print!, format!, any IO, etc., but it's likely to be much broader than just this when I actually use it.

If it doesn't exist, I'd write one using syn and make it configurable. If it does exist, why re-implement the wheel.

1 Like

clippy::disallowed_methods and clippy::disallowed_macros can do this.

8 Likes

This is exactly what I was looking for, thank you.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.