Skip to content

Conversation

FintanH
Copy link
Collaborator

@FintanH FintanH commented Jan 13, 2025

Currently includes #69

src/lib.rs Outdated
$crate::NonEmpty {
head: $h,
tail: alloc::vec::Vec::new(),
tail: vec![],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This runs into issues with macro hygiene:

It would have to be something like $crate::__macro_support::vec instead.

See e.g. tokio-rs/tracing#1918

@epatters
Copy link

Would it be possible to merge this soon? Getting a fix to #68 would be much appreciated!

FintanH and others added 5 commits July 19, 2025 14:52
It was a misnomer to name the feature flag `bincode2` since that is the name of
unmaintained library. The library `bincode` is actively maintained, so the
feature flag is named after it instead.

There is a proper version release v2.0.1 now, which is specified instead. The
derive is cleaned up, and there is a roundtrip test added.
As pointed out[^0], `nonempty!` runs into macro hygiene issues. Use the same
approach as tracing[^1] to re-export the `vec!` macro and qualify it using the
`$crate` syntax.

[^0]: #70 (comment)
[^1]: https://github.com/tokio-rs/tracing/blob/e63ef57f3d686abe3727ddd586eb9af73d6715b7/tracing/src/lib.rs#L987
Signed-off-by: Fintan Halpenny <[email protected]>
X-Clacks-Overhead: GNU Terry Pratchett
@FintanH FintanH merged commit 95d5cb1 into master Jul 19, 2025
5 checks passed
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

Successfully merging this pull request may close these issues.

4 participants