Skip to content

Commit b3ddaf4

Browse files
committed
Minor wording and syntax improvements
1 parent 3faf1be commit b3ddaf4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/rust-2021/reserving-syntax.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
## Summary
44

5-
- `any_prefix#`, `any_prefix"..."`, and `any_prefix'...'` are now reserved
5+
- `any_identifier#`, `any_identifier"..."`, and `any_identifier'...'` are now reserved
66
syntax, and no longer tokenize.
77
- This is mostly relevant to macros. E.g. `quote!{ #a#b }` is no longer accepted.
8-
- It doesn't treat keywords specially, so e.g. `match".." {}` is no longer accepted.
8+
- It doesn't treat keywords specially, so e.g. `match"..." {}` is no longer accepted.
99
- Insert whitespace to avoid errors.
1010

1111
## Details
@@ -14,9 +14,11 @@ To make space for new syntax in the future,
1414
we've decided to reserve syntax for prefixed identifiers and literals:
1515
`prefix#identifier`, `prefix"string"`, `prefix'c'`, and `prefix#123`,
1616
where `prefix` can be any identifier.
17-
(Except those that already have a meaning, such as `b'…'` and `r"…"`.)
17+
(Except those prefixes that already have a meaning, such as `b'...'` (byte
18+
strings) and `r"..."` (raw strings).)
19+
1820
This provides syntax we can expand into in the future without requiring an
19-
edition boundary. We may use that for temporary syntax until the next edition,
21+
edition boundary. We may use this for temporary syntax until the next edition,
2022
or for permanent syntax if appropriate.
2123

2224
Without an edition, this would be a breaking change, since macros can currently

0 commit comments

Comments
 (0)