Skip to content

Commit 9994c12

Browse files
committed
Remove tuple index carve out
This is being proposed to be removed in <rust-lang/rust#145463> as we never intended for this to be valid syntax.
1 parent ff45844 commit 9994c12

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/tokens.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,18 +637,18 @@ start with `0` and each successive index increments the value by `1` as a
637637
decimal value. Thus, only decimal values will match, and the value must not
638638
have any extra `0` prefix characters.
639639

640+
Tuple indices may not include any suffixes (such as `usize`).
641+
640642
```rust,compile_fail
641643
let example = ("dog", "cat", "horse");
642644
let dog = example.0;
643645
let cat = example.1;
644646
// The following examples are invalid.
645647
let cat = example.01; // ERROR no field named `01`
646648
let horse = example.0b10; // ERROR no field named `0b10`
649+
let unicorn = example.0usize; // ERROR suffixes on a tuple index are invalid
647650
```
648651

649-
> [!NOTE]
650-
> Tuple indices may include certain suffixes, but this is not intended to be valid, and may be removed in a future version. See <https://github.com/rust-lang/rust/issues/60210> for more information.
651-
652652
r[lex.token.literal.float]
653653
#### Floating-point literals
654654

0 commit comments

Comments
 (0)