From 02ba07fc700082a1a396dab641fdc65fe6fae8f4 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Wed, 15 Mar 2017 20:04:24 -0400 Subject: [PATCH 1/6] Fill in short definitons for keywords --- second-edition/src/appendix-01-keywords.md | 106 +++++++++++---------- 1 file changed, 54 insertions(+), 52 deletions(-) diff --git a/second-edition/src/appendix-01-keywords.md b/second-edition/src/appendix-01-keywords.md index 167ea50c6..e2a0c5e9a 100644 --- a/second-edition/src/appendix-01-keywords.md +++ b/second-edition/src/appendix-01-keywords.md @@ -4,55 +4,57 @@ The following keywords are reserved by the Rust language and may not be used as names of functions, variables, macros, modules, crates, constants, static values, attributes, struct fields, or parameters. -* `abstract` -* `alignof` -* `as` -* `become` -* `box` -* `break` -* `const` -* `continue` -* `crate` -* `do` -* `else` -* `enum` -* `extern` -* `false` -* `final` -* `fn` -* `for` -* `if` -* `impl` -* `in` -* `let` -* `loop` -* `macro` -* `match` -* `mod` -* `move` -* `mut` -* `offsetof` -* `override` -* `priv` -* `proc` -* `pub` -* `pure` -* `ref` -* `return` -* `Self` -* `self` -* `sizeof` -* `static` -* `struct` -* `super` -* `trait` -* `true` -* `type` -* `typeof` -* `unsafe` -* `unsized` -* `use` -* `virtual` -* `where` -* `while` -* `yield` +* `abstract` - reserved for future use +* `alignof` - reserved for future use +* `as` - primitive casting, or disambiguating the specific trait containing an + item +* `become` - reserved for future use +* `box` - reserved for future use +* `break` - exit a loop immediately +* `const` - constant items and constant raw pointers +* `continue` - continue to the next loop iteration +* `crate` - external crate linkage +* `do` - reserved for future use +* `else` - fallback for `if` and `if let` control flow constructs +* `enum` - defining an enumeration +* `extern` - external crate, function, and variable linkage +* `false` - boolean false literal +* `final` - reserved for future use +* `fn` - function definition and function pointer type +* `for` - iterator loop, part of trait impl syntax, and higher-ranked lifetime + syntax +* `if` - conditional branching +* `impl` - inherent and trait implementation block +* `in` - part of `for` loop syntax +* `let` - variable binding +* `loop` - unconditional, infinite loop +* `macro` - reserved for future use +* `match` - pattern matching +* `mod` - module declaration +* `move` - part of closure syntax +* `mut` - denotes mutability in pointer types and pattern bindings +* `offsetof` - reserved for future use +* `override` - reserved for future use +* `priv` - reserved for future use +* `proc` - reserved for future use +* `pub` - denotes public visibility in struct fields, `impl` blocks, and modules +* `pure` - reserved for future use +* `ref` - by-reference binding +* `return` - return from function +* `Self` - implementor type alias +* `self` - method subject +* `sizeof` - reserved for future use +* `static` - global variable +* `struct` - structure definition +* `super` - parent module of the current module +* `trait` - trait definition +* `true` - boolean true literal +* `type` - type alias and associated type definition +* `typeof` - reserved for future use +* `unsafe` - denotes unsafe code, functions, traits, and implementations +* `unsized` - reserved for future use +* `use` - import symbols into scope +* `virtual` - reserved for future use +* `where` - type constraint clauses +* `while` - conditional loop +* `yield` - reserved for future use From df2faed2c2bf2e1e46013987ac1ac7c7653a506d Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Tue, 21 Mar 2017 21:16:12 -0400 Subject: [PATCH 2/6] Add more places you can't use keywords Also reorder by likelihood of encountering, ish. --- second-edition/src/appendix-01-keywords.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/second-edition/src/appendix-01-keywords.md b/second-edition/src/appendix-01-keywords.md index e2a0c5e9a..bcd435950 100644 --- a/second-edition/src/appendix-01-keywords.md +++ b/second-edition/src/appendix-01-keywords.md @@ -1,8 +1,9 @@ ## Appendix A: Keywords The following keywords are reserved by the Rust language and may not be used as -names of functions, variables, macros, modules, crates, constants, static -values, attributes, struct fields, or parameters. +identifiers such as names of functions, variables, parameters, struct fields, +modules, crates, constants, macros, static values, attributes, types, traits, +or lifetimes. * `abstract` - reserved for future use * `alignof` - reserved for future use From 6f7a720c2e9f154db614f17178d5ad9ff87b8bd1 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Tue, 21 Mar 2017 21:16:39 -0400 Subject: [PATCH 3/6] Move all crates reserved for future use to the end --- second-edition/src/appendix-01-keywords.md | 42 +++++++++++++--------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/second-edition/src/appendix-01-keywords.md b/second-edition/src/appendix-01-keywords.md index bcd435950..bf0cc44f5 100644 --- a/second-edition/src/appendix-01-keywords.md +++ b/second-edition/src/appendix-01-keywords.md @@ -5,22 +5,18 @@ identifiers such as names of functions, variables, parameters, struct fields, modules, crates, constants, macros, static values, attributes, types, traits, or lifetimes. -* `abstract` - reserved for future use -* `alignof` - reserved for future use +### Keywords Currently in Use + * `as` - primitive casting, or disambiguating the specific trait containing an item -* `become` - reserved for future use -* `box` - reserved for future use * `break` - exit a loop immediately * `const` - constant items and constant raw pointers * `continue` - continue to the next loop iteration * `crate` - external crate linkage -* `do` - reserved for future use * `else` - fallback for `if` and `if let` control flow constructs * `enum` - defining an enumeration * `extern` - external crate, function, and variable linkage * `false` - boolean false literal -* `final` - reserved for future use * `fn` - function definition and function pointer type * `for` - iterator loop, part of trait impl syntax, and higher-ranked lifetime syntax @@ -29,33 +25,45 @@ or lifetimes. * `in` - part of `for` loop syntax * `let` - variable binding * `loop` - unconditional, infinite loop -* `macro` - reserved for future use * `match` - pattern matching * `mod` - module declaration * `move` - part of closure syntax * `mut` - denotes mutability in pointer types and pattern bindings -* `offsetof` - reserved for future use -* `override` - reserved for future use -* `priv` - reserved for future use -* `proc` - reserved for future use * `pub` - denotes public visibility in struct fields, `impl` blocks, and modules -* `pure` - reserved for future use * `ref` - by-reference binding * `return` - return from function * `Self` - implementor type alias * `self` - method subject -* `sizeof` - reserved for future use * `static` - global variable * `struct` - structure definition * `super` - parent module of the current module * `trait` - trait definition * `true` - boolean true literal * `type` - type alias and associated type definition -* `typeof` - reserved for future use * `unsafe` - denotes unsafe code, functions, traits, and implementations -* `unsized` - reserved for future use * `use` - import symbols into scope -* `virtual` - reserved for future use * `where` - type constraint clauses * `while` - conditional loop -* `yield` - reserved for future use + +### Keywords Reserved for Future Use + +These keywords do not have any functionality, but are reserved by Rust for +potential future use. + +* `abstract` +* `alignof` +* `become` +* `box` +* `do` +* `final` +* `macro` +* `offsetof` +* `override` +* `priv` +* `proc` +* `pure` +* `sizeof` +* `typeof` +* `unsized` +* `virtual` +* `yield` From 4de7a361ca0d186febceb75c3afb3a0b9532be06 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Tue, 21 Mar 2017 21:17:37 -0400 Subject: [PATCH 4/6] Wording tweaks in keyword explanations --- second-edition/src/appendix-01-keywords.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/second-edition/src/appendix-01-keywords.md b/second-edition/src/appendix-01-keywords.md index bf0cc44f5..f1ebc5d10 100644 --- a/second-edition/src/appendix-01-keywords.md +++ b/second-edition/src/appendix-01-keywords.md @@ -7,8 +7,8 @@ or lifetimes. ### Keywords Currently in Use -* `as` - primitive casting, or disambiguating the specific trait containing an - item +* `as` - primitive casting, disambiguating the specific trait containing an + item, or renaming items in `use` and `extern crate` statements * `break` - exit a loop immediately * `const` - constant items and constant raw pointers * `continue` - continue to the next loop iteration @@ -27,14 +27,14 @@ or lifetimes. * `loop` - unconditional, infinite loop * `match` - pattern matching * `mod` - module declaration -* `move` - part of closure syntax -* `mut` - denotes mutability in pointer types and pattern bindings +* `move` - makes a closure take ownership of all its captures +* `mut` - denotes mutability in references, raw pointers, and pattern bindings * `pub` - denotes public visibility in struct fields, `impl` blocks, and modules * `ref` - by-reference binding * `return` - return from function * `Self` - implementor type alias -* `self` - method subject -* `static` - global variable +* `self` - method subject or current module +* `static` - global variable or lifetime lasting the entire program execution * `struct` - structure definition * `super` - parent module of the current module * `trait` - trait definition From 120c1c1d2c29529ac67c1910a4bc336badfc7241 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Tue, 21 Mar 2017 21:33:52 -0400 Subject: [PATCH 5/6] Fix spelling of implementer --- second-edition/src/appendix-01-keywords.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/second-edition/src/appendix-01-keywords.md b/second-edition/src/appendix-01-keywords.md index f1ebc5d10..819251ff7 100644 --- a/second-edition/src/appendix-01-keywords.md +++ b/second-edition/src/appendix-01-keywords.md @@ -32,7 +32,7 @@ or lifetimes. * `pub` - denotes public visibility in struct fields, `impl` blocks, and modules * `ref` - by-reference binding * `return` - return from function -* `Self` - implementor type alias +* `Self` - implementer type alias * `self` - method subject or current module * `static` - global variable or lifetime lasting the entire program execution * `struct` - structure definition From 2d448d8eb1dc8f2036c29dceef73b1f919adb8d6 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Wed, 22 Mar 2017 08:51:27 -0400 Subject: [PATCH 6/6] Tweaks to crate and Self --- second-edition/src/appendix-01-keywords.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/second-edition/src/appendix-01-keywords.md b/second-edition/src/appendix-01-keywords.md index 819251ff7..f578103c9 100644 --- a/second-edition/src/appendix-01-keywords.md +++ b/second-edition/src/appendix-01-keywords.md @@ -12,7 +12,8 @@ or lifetimes. * `break` - exit a loop immediately * `const` - constant items and constant raw pointers * `continue` - continue to the next loop iteration -* `crate` - external crate linkage +* `crate` - external crate linkage or a macro variable representing the crate + in which the macro is defined * `else` - fallback for `if` and `if let` control flow constructs * `enum` - defining an enumeration * `extern` - external crate, function, and variable linkage @@ -32,7 +33,7 @@ or lifetimes. * `pub` - denotes public visibility in struct fields, `impl` blocks, and modules * `ref` - by-reference binding * `return` - return from function -* `Self` - implementer type alias +* `Self` - type alias for the type implementing a trait * `self` - method subject or current module * `static` - global variable or lifetime lasting the entire program execution * `struct` - structure definition