Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible misuse of #[zenoh_macros::unstable] and #[zenoh_macros::unstable_doc] #1074

Closed
milyin opened this issue May 31, 2024 · 2 comments
Closed
Labels
release Part of the next release

Comments

@milyin
Copy link
Contributor

milyin commented May 31, 2024

Describe the release item

The #[zenoh_macros::unstable] is fully equal to #[cfg(attribute="unstable")]
The #[zenoh_macros::unstable_doc] gives additional functionality: it adds information to documnatation that this is unstable feature.
Also just #[cfg(attribute="unstable")] is actively used

The proposal is:

  • remove #[zenoh_macros::unstable]: replace it to #[cfg(attribute="unstable")] for pieces of code and to #[zenoh_macros::unstable_doc] where the documentation should be corrected.
  • add check to #[zenoh_macros::unstable_doc] forbidding it's usage if no documentation for item exists
@milyin milyin added the release Part of the next release label May 31, 2024
@wyfo
Copy link
Contributor

wyfo commented Jun 3, 2024

The #[zenoh_macros::unstable] is fully equal to #[cfg(attribute="unstable")]

I'm not sure to following you. #[zenoh_macros::unstable] is equivalent to #[cfg(attribute="unstable")]#[zenoh_macros::unstable_doc], not just #[cfg(attribute="unstable")].

If I've understood correctly, zenoh_macros::unstable_doc is for items of "unstable" crates, like zenoh-shm, which are reexported in zenoh. These crate don't have a unstable feature, so zenoh_macros::unstable would not have sense.
So both are needed.

add check to #[zenoh_macros::unstable_doc] forbidding it's usage if no documentation for item exists

I'm +1 on that.

@milyin
Copy link
Contributor Author

milyin commented Jun 3, 2024

About equivalence - it was my mistake, zenoh_macros::unstable also updates documentation.
Yes, I found that we can't remove unstable_doc - it seems if was specially created for adding "unstable" documentation comment to crate without scattering unstable feature everywhere.
About forbidding usage of macro when no documentation - seems like it adds more problems than solves. It becomes easy to add documentation and forget to add zenoh_macros::unstable.
So closing it as not a bug.

@milyin milyin closed this as not planned Won't fix, can't repro, duplicate, stale Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release Part of the next release
Projects
Status: Done
Development

No branches or pull requests

2 participants