Skip to content

Commit 942c40e

Browse files
committed
Note that tt can be used to match a lifetime
1 parent 08a98b4 commit 942c40e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

text/0000-macro-lifetimes.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ a macro is going to need to deal with lifetimes eventually. They're also
1818
commonly needed for any macros that need to deal with types in a more granular
1919
way than just `ty`.
2020

21-
Since a lifetime is a single token, there is currently no way to accept one
22-
without an explicit matcher. Something like `'$lifetime:ident` will fail to
23-
compile.
21+
Since a lifetime is a single token, the only way to match against a lifetime is
22+
by capturing it as `tt`. Something like `'$lifetime:ident` would fail to
23+
compile. This is extremely limiting, as it becomes difficult to sanitize input,
24+
and `tt` is extremely difficult to use in a sequence without using awkward
25+
separators.
2426

2527
# Detailed design
2628
[design]: #detailed-design

0 commit comments

Comments
 (0)