lib/ringbuf: fix two macro syntax bugs in no_dedup and all-disabled arms#2570
Open
NeonPhantom123 wants to merge 4 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two syntactically invalid macro arms in lib/ringbuf/src/lib.rs.
The first is in the
#[cfg(not(feature = "disabled"))]ringbuf!macro,no_dedupnamed arm (line 295). The type expression readsRingbuf<$t, () $n>— two adjacent generic arguments with no separator.Rust requires a comma between them; the correct form is
Ringbuf<$t, (), $n>.The parallel default arm on line 283 already has this right (
u16, $n).The second is in the
#[cfg(all(counters, counters-disabled, disabled))]counted_ringbuf!macro,no_dedupnamed arm (line 434). The recursivecall uses
%nameinstead of$name—%is not a Rust macro metavariablesigil. Every other forwarding arm in the file uses
$name; this one wasa typo.
Neither arm has an active caller in this repo under the currently enabled
feature combinations, so both are latent compile errors. Adds three
integration tests (one function per file, one static per test) covering
the named no_dedup arm, the unnamed delegation form, and the no-collapse
behaviour that distinguishes no_dedup from the default dedup mode.