You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is being proposed to be removed in
<rust-lang/rust#145463> as we never intended for
this to be valid syntax.
Also include an invalid tuple index with underscore example.
@@ -637,18 +637,19 @@ start with `0` and each successive index increments the value by `1` as a
637
637
decimal value. Thus, only decimal values will match, and the value must not
638
638
have any extra `0` prefix characters.
639
639
640
+
Tuple indices may not include any suffixes (such as `usize`).
641
+
640
642
```rust,compile_fail
641
643
let example = ("dog", "cat", "horse");
642
644
let dog = example.0;
643
645
let cat = example.1;
644
646
// The following examples are invalid.
645
647
let cat = example.01; // ERROR no field named `01`
646
648
let horse = example.0b10; // ERROR no field named `0b10`
649
+
let unicorn = example.0usize; // ERROR suffixes on a tuple index are invalid
650
+
let underscore = example.0_0; // ERROR no field `0_0` on type `(&str, &str, &str)`
647
651
```
648
652
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.
0 commit comments