Does rust have an attr like #[deprecated]?

Does rust have an attr like #[deprecated]?
I'm developing a library use rust.Some function or struct of this lib is beta, maybe they will be removed in a future release.So I am finding for a attr like #[deprecated],when i put it on my function,this means this function is a beta function.If some use this function,they will get a warning of this attr at the time of the build.
I checked this page but not found a appropriate attr,I'm wondering what to do.

It's called exactly #[deprecated]. However, that's not the same as "unstable" or "beta". Deprecation means that an API was once stable (possibly), but it's been superseded because its design was deemed suboptimal, so it's being phased out and replaced with an API of better design. It expressly does not mean "experimental" in itself.

8 Likes

You can also use cfg to lock things behind a feature flag. Then you can just tell users to use your library with the "beta" or "nightly" (or something else) feature to use unstable features.

4 Likes