You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Rust 2024, we'll be reserving -- at tokenization time -- the hash characters ## (and all longer joined sequences of hash characters). You can learn more about this change here:
In this commit 1f3418c of the peg crate, you added "##method() syntax to call a method on the input object".
Users who migrate to Rust 2024 will not be able to use this syntax.
Generally, our recommendation to callers of macros that expect ## would be to add a space. However, that doesn't work in the case of the peg crate, as the implementation checks specifically for jointness.
We notice that though this feature was added many years ago and that it doesn't seem to be documented or, as best as we can tell, widely used.
We're curious what the story is on this feature. In particular we want to check that there's not some critical use case for this that we've missed. And we're curious about how or whether you'll migrate this feature. Given that it was seemingly never documented, we wonder whether you even meant for this to be part of the surface area of your crate.
The ##method() syntax is an escape hatch for calling into a method on the parser input as if it were a parse rule. When I added it, it was intended to be temporary, because I needed it for rust-peg's own parser for the PEG grammar DSL. I actually used the ## with the intention of reserving the single # for a more flexible version of the feature that takes a block of Rust code rather than specifically a method on the input type.
6 years later, I guess it's not so temporary, and I still need to decide on the exact syntax for that replacement, but I'm fine with deprecating the ## syntax. Since it was never documented, I expect few people to be using it.
In Rust 2024, we'll be reserving -- at tokenization time -- the hash characters
##
(and all longer joined sequences of hash characters). You can learn more about this change here:In this commit 1f3418c of the
peg
crate, you added "##method()
syntax to call a method on the input object".Users who migrate to Rust 2024 will not be able to use this syntax.
Generally, our recommendation to callers of macros that expect
##
would be to add a space. However, that doesn't work in the case of thepeg
crate, as the implementation checks specifically for jointness.We notice that though this feature was added many years ago and that it doesn't seem to be documented or, as best as we can tell, widely used.
We're curious what the story is on this feature. In particular we want to check that there's not some critical use case for this that we've missed. And we're curious about how or whether you'll migrate this feature. Given that it was seemingly never documented, we wonder whether you even meant for this to be part of the surface area of your crate.
Thanks.
See:
#"
,##"
,###
rust-lang/rust#133924cc @kevinmehall
The text was updated successfully, but these errors were encountered: