I've got a function I want to export in my module so people can use it. However, in ≈95% of cases, using it is a bad idea.
/// Check whether foo is a metasyntactic variable.
///
/// **Using this function is a mistake.** This function is slow,
/// since checking widgets is an extremely expensive operation.
/// You should be keeping track of what's what, and ideally will
/// never need to use this function.
///
/// If you _do_ need to use this function, please consider a refactor.
pub fn test_widget(foo: String) -> bool {
false
}
It's mostly around for documentation and testing purposes. However, since there's the ≈5% of cases where such a thing may be genuinely useful, I want to keep it around.
I don't want people accidentally using it, so I want to make invocation of the function cause a compiler warning (unless they explicitly override it with allow or something). How can I do this?