diff options
| author | bors <bors@rust-lang.org> | 2015-12-01 17:59:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-12-01 17:59:42 +0000 |
| commit | dfe88bf1e5a87861ccaf57ea45f3ebe0e8c2de7d (patch) | |
| tree | 00b191c67ee738a25f99391e61d71eb939026463 | |
| parent | ed121aa89780d1495e6a6a215b8e0cf7894a2d24 (diff) | |
| parent | a34274c8eae4c86c42b823ed3cbf903c9159486a (diff) | |
| download | rust-dfe88bf1e5a87861ccaf57ea45f3ebe0e8c2de7d.tar.gz rust-dfe88bf1e5a87861ccaf57ea45f3ebe0e8c2de7d.zip | |
Auto merge of #29391 - DanielKeep:syntax-index, r=steveklabnik
* `const`: Add reference to raw pointers * Change `expr!(...)` etc. examples to use `ident` instead. *Technically*, it should be `pat`, but that's not how it works in practice. * `|`: add reference to closure syntax. * Closure syntax entry. * Indexing and slicing entries. * Add history of obsolete and deprecated syntax. r? @steveklabnik
| -rw-r--r-- | src/doc/book/syntax-index.md | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/doc/book/syntax-index.md b/src/doc/book/syntax-index.md index d0b46ed3719..528c0b537f3 100644 --- a/src/doc/book/syntax-index.md +++ b/src/doc/book/syntax-index.md @@ -4,7 +4,7 @@ * `as`: primitive casting. See [Casting Between Types (`as`)]. * `break`: break out of loop. See [Loops (Ending Iteration Early)]. -* `const`: constant items. See [`const` and `static`]. +* `const`: constant items and constant raw pointers. See [`const` and `static`], [Raw Pointers]. * `continue`: continue to next loop iteration. See [Loops (Ending Iteration Early)]. * `crate`: external crate linkage. See [Crates and Modules (Importing External Crates)]. * `else`: fallback for `if` and `if let` constructs. See [`if`], [`if let`]. @@ -39,7 +39,7 @@ ## Operators and Symbols -* `!` (`expr!(…)`, `expr!{…}`, `expr![…]`): denotes macro expansion. See [Macros]. +* `!` (`ident!(…)`, `ident!{…}`, `ident![…]`): denotes macro expansion. See [Macros]. * `!` (`!expr`): bitwise or logical complement. Overloadable (`Not`). * `%` (`expr % expr`): arithmetic remainder. Overloadable (`Rem`). * `%=` (`var %= expr`): arithmetic remainder & assignment. @@ -89,6 +89,7 @@ * `^=` (`var ^= expr`): bitwise exclusive or & assignment. * `|` (`expr | expr`): bitwise or. Overloadable (`BitOr`). * `|` (`pat | pat`): pattern alternatives. See [Patterns (Multiple patterns)]. +* `|` (`|…| expr`): closures. See [Closures]. * `|=` (`var |= expr`): bitwise or & assignment. * `||` (`expr || expr`): logical or. * `_`: "ignored" pattern binding. See [Patterns (Ignoring bindings)]. @@ -105,6 +106,7 @@ * `br"…"`, `br#"…"#`, `br##"…"##`, …: raw byte string literal, combination of raw and byte string literal. See [Reference (Raw Byte String Literals)]. * `'…'`: character literal. See [Primitive Types (`char`)]. * `b'…'`: ASCII byte literal. +* `|…| expr`: closure. See [Closures]. <!-- Path-related syntax --> @@ -173,6 +175,8 @@ * `[…]`: array literal. See [Primitive Types (Arrays)]. * `[expr; len]`: array literal containing `len` copies of `expr`. See [Primitive Types (Arrays)]. * `[type; len]`: array type containing `len` instances of `type`. See [Primitive Types (Arrays)]. +* `expr[expr]`: collection indexing. Overloadable (`Index`, `IndexMut`). +* `expr[..]`, `expr[a..]`, `expr[..b]`, `expr[a..b]`: collection indexing pretending to be collection slicing, using `Range`, `RangeFrom`, `RangeTo`, `RangeFull` as the "index". [`const` and `static` (`static`)]: const-and-static.html#static [`const` and `static`]: const-and-static.html |
