{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreie3xmuqbce6ftvykii77oe3kowaujqnsggmtfecet2la7mpoldf6m",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mo4yinjfgrb2"
},
"path": "/t/why-cant-pat-param-be-followed-by-a-colon-in-macro-rules/24394#post_1",
"publishedAt": "2026-06-12T22:23:01.000Z",
"site": "https://internals.rust-lang.org",
"tags": [
"this macro",
"PatternNoTopAlt",
"StructPatternField",
"let statement"
],
"textContent": "I wrote this macro only to discover that `pat_param` fragments (otherwise known as PatternNoTopAlts cannot be followed by `:`s. As far as I can tell, PatternNoTopAlts cannot be terminated by a `:`. I get that there are potential forward compatibility concerns, but it is also my understanding that StructPatternFields make the prospect of adding type annotations to patterns quite awkward, and I figured that the ability to match something as integral as a let statement would be a higher priority.\n\nAre there any other uses of `:` in patterns being considered?",
"title": "Why can't pat_param be followed by a colon in macro_rules?"
}