# \[Pre-Pre RFC\] Escaping repetition operators in delimiter position

**URL:** https://internals.rust-lang.org/t/pre-pre-rfc-escaping-repetition-operators-in-delimiter-position/24178
**Category:** language design
**Created:** [April 15, 2026, 3:12pm UTC](https://internals.rust-lang.org/t/pre-pre-rfc-escaping-repetition-operators-in-delimiter-position/24178 "2026-04-15T15:12:29Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Apersoma](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/apersoma/32/14135_2.png) [@Apersoma](https://internals.rust-lang.org/u/Apersoma)
#### Post date: [April 15, 2026, 3:12pm UTC](https://internals.rust-lang.org/t/pre-pre-rfc-escaping-repetition-operators-in-delimiter-position/24178/1 "2026-04-15T15:12:29Z")

</div>

Right now there isn't a way to use `+`, `*`, or `?` as a delimiter in a declarative macro. This sucks since `+` and `*` are binary operators which mean they effectively behave as a delimiter in many contexts and being able to match syntax within a macro to the rest of the language or even outside of it is incredibly useful. I propose that escaping a repetition character that is in the delimiter position will do just that, escape the repetition character.

Now while there are a ton of hacky ways to get around this, having official support and making it not hacky will open it up in certain places and generally increase code readability.

### Example:

```rust
use core::num::*;
use core::ops::*;
trait Foo {
    fn foo(self) -> u32;
}
macro_rules! foo_for_generic_wrapper {
    ($W:ident<T$(: $($constraint:ident)\++>)?) => {
         impl<T> Foo for $t<T>
         $(where T: $($constraint)\++)?
         {
              fn foo(self) -> u32 {
                    self.0.foo()
              }
         }
    };
}
foo_for_generic_wrapper!(Wrapping<T>);
foo_for_generic_wrapper!(Saturating<T>);
// pretend ZeroablePrimitive is exposed
foo_for_generic_wrapper!(NonZero<T: ZeroablePrimitive>);
struct FourFunction<T: 
    Add<Self, Output=Self>
    + Sub<Self, Output=Self>
    + Mul<Self, Output=Self>
    + Div<Self, Output=Self>
>(T);
foo_for_generic_wrapper!(FourFunction<T: 
    Add<Self, Output=Self>
    + Sub<Self, Output=Self>
    + Mul<Self, Output=Self>
    + Div<Self, Output=Self>
>);

```

Previous discussion:

- [Idea: escaping macro separators](https://internals.rust-lang.org/t/idea-escaping-macro-separators/7877)
