From 2b5983423dc3459eb8eb319b518c6a6bf0acf3d2 Mon Sep 17 00:00:00 2001 From: Daniel Keep Date: Fri, 9 Oct 2015 23:06:20 +1100 Subject: [PATCH] Corrections to syntax index. * removed reference to struct fields from `mut` description. * changed `..` pattern example to not be syntactically bogus. * changed `@` pattern example for similar reasons. (Thanks petrochenkov) --- src/doc/trpl/syntax-index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doc/trpl/syntax-index.md b/src/doc/trpl/syntax-index.md index 7bbea8314f2..fd8086efde0 100644 --- a/src/doc/trpl/syntax-index.md +++ b/src/doc/trpl/syntax-index.md @@ -21,7 +21,7 @@ * `match`: pattern matching. See [Match]. * `mod`: module declaration. See [Crates and Modules (Defining Modules)]. * `move`: part of closure syntax. See [Closures (`move` closures)]. -* `mut`: denotes mutability in pointer types, pattern bindings, and `struct` fields. See [Mutability]. +* `mut`: denotes mutability in pointer types and pattern bindings. See [Mutability]. * `pub`: denotes public visibility in `struct` fields, `impl` blocks, and modules. See [Crates and Modules (Exporting a Public Interface)]. * `ref`: by-reference binding. See [Patterns (`ref` and `ref mut`)]. * `return`: return from function. See [Functions (Early Returns)]. @@ -63,7 +63,7 @@ * `.` (`expr.ident`): member access. See [Structs], [Method Syntax]. * `..` (`..`, `expr..`, `..expr`, `expr..expr`): right-exclusive range literal. * `..` (`..expr`): struct literal update syntax. See [Structs (Update syntax)]. -* `..` (`..ident`): "and the rest" pattern binding. See [Patterns (Ignoring bindings)]. +* `..` (`variant(x, ..)`, `struct_type { x, .. }`): "and the rest" pattern binding. See [Patterns (Ignoring bindings)]. * `...` (`expr ... expr`): inclusive range pattern. See [Patterns (Ranges)]. * `/` (`expr / expr`): arithmetic division. Overloadable (`Div`). * `/=` (`var /= expr`): arithmetic division & assignment. @@ -83,7 +83,7 @@ * `>=` (`var >= expr`): greater-than or equal-to comparison. Overloadable (`Cmp`, `PartialCmp`). * `>>` (`expr >> expr`): right-shift. Overloadable (`Shr`). * `>>=` (`var >>= expr`): right-shift & assignment. -* `@` (`expr @ expr`): pattern binding. See [Patterns (Bindings)]. +* `@` (`ident @ pat`): pattern binding. See [Patterns (Bindings)]. * `^` (`expr ^ expr`): bitwise exclusive or. Overloadable (`BitXor`). * `^=` (`var ^= expr`): bitwise exclusive or & assignment. * `|` (`expr | expr`): bitwise or. Overloadable (`BitOr`). -- 2.44.0