Skip to content

Commit dceaaca

Browse files
committed
Make some editorial tweaks
1 parent 91e1efc commit dceaaca

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/rust-2024/reserved-syntax.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ More information may be found in the tracking issue at <https://github.com/rust-
1010

1111
## Details
1212

13-
[RFC 3593] reserved syntax in the 2024 Edition for guarded string literals that do not have a prefix to future-proof against future language changes. The 2021 Edition [reserved syntax][2021] for guarded strings with a prefix, such as `ident##"foo"##`. The 2024 Edition extends that to also reserve strings without the `ident` prefix.
13+
[RFC 3593] reserved syntax in the 2024 Edition for guarded string literals that do not have a prefix to make room for possible future language changes. The 2021 Edition [reserved syntax][2021] for guarded strings with a prefix, such as `ident##"foo"##`. The 2024 Edition extends that to also reserve strings without the `ident` prefix.
1414

15-
There are two reserved syntaxes: One or more `#` immediately followed by a [string literal], and two or more `#` characters in a row.
15+
There are two reserved syntaxes:
1616

17-
This reservation is done across an edition boundary because of interactions with tokenization and macros. For example, with the following macro:
17+
- One or more `#` characters immediately followed by a [string literal].
18+
- Two or more `#` characters in a row (not separated by whitespace).
19+
20+
This reservation is done across an edition boundary because of interactions with tokenization and macros. For example, consider this macro:
1821

1922
```rust
2023
macro_rules! demo {
@@ -45,7 +48,7 @@ Starting in the 2024 Edition, the `#"foo"#` line and the `###` line now generate
4548

4649
## Migration
4750

48-
The [`rust_2024_guarded_string_incompatible_syntax`] lint will identify any tokens that match the reserved syntax, and will suggest a modification to insert spaces where necessary to ensure it continues to be parsed as separate tokens.
51+
The [`rust_2024_guarded_string_incompatible_syntax`] lint will identify any tokens that match the reserved syntax, and will suggest a modification to insert spaces where necessary to ensure the tokens continue to be parsed separately.
4952

5053
The lint is part of the `rust-2024-compatibility` lint group which is included in the automatic edition migration. In order to migrate your code to be Rust 2024 Edition compatible, run:
5154

0 commit comments

Comments
 (0)