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

pub use counters::Count in ringbuf can't actually be used correctly #1951

Open
hawkw opened this issue Dec 13, 2024 · 0 comments
Open

pub use counters::Count in ringbuf can't actually be used correctly #1951

hawkw opened this issue Dec 13, 2024 · 0 comments

Comments

@hawkw
Copy link
Member

hawkw commented Dec 13, 2024

The Count derive macro attempts to implement the counters::Count trait, so it doesn't work unless the crate in which the macro is expanded has a counters dependency. The ringbuf crate reexports the derive macro, which gives the impression that you can use that without having a direct dependency on counters...but if you do this, your code won't compile. Users still need to add a counters dependency as well, so the re-export doesn't actually do anything useful.

We should probably get rid of it, as it's really just a footgun (but like, a...foot rubber band gun; you can use it to shoot yourself in the foot, but the consequences of shooting yourself in the foot with it are "kind of annoying" but ultimately harmless).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant