1
1
#[ doc( keyword = "as" ) ]
2
2
//
3
- /// The keyword for casting a value to a type .
3
+ /// Cast between types, or rename an import .
4
4
///
5
5
/// `as` is most commonly used to turn primitive types into other primitive types, but it has other
6
6
/// uses that include turning pointers into addresses, addresses into pointers, and pointers into
29
29
/// [`crate`]: keyword.crate.html
30
30
mod as_keyword { }
31
31
32
+ #[ doc( keyword = "break" ) ]
33
+ //
34
+ /// Exit early from a loop.
35
+ ///
36
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
37
+ ///
38
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
39
+ mod break_keyword { }
40
+
32
41
#[ doc( keyword = "const" ) ]
33
42
//
34
- /// The keyword for defining constants .
43
+ /// Compile-time constants and deterministic functions .
35
44
///
36
45
/// Sometimes a certain value is used many times throughout a program, and it can become
37
46
/// inconvenient to copy it over and over. What's more, it's not always possible or desirable to
@@ -83,9 +92,18 @@ mod as_keyword { }
83
92
/// [Reference]: ../reference/items/constant-items.html
84
93
mod const_keyword { }
85
94
95
+ #[ doc( keyword = "continue" ) ]
96
+ //
97
+ /// Skip to the next iteration of a loop.
98
+ ///
99
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
100
+ ///
101
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
102
+ mod continue_keyword { }
103
+
86
104
#[ doc( keyword = "crate" ) ]
87
105
//
88
- /// The `crate` keyword .
106
+ /// A Rust binary or library .
89
107
///
90
108
/// The primary use of the `crate` keyword is as a part of `extern crate` declarations, which are
91
109
/// used to specify a dependency on a crate external to the one it's declared in. Crates are the
@@ -116,14 +134,24 @@ mod const_keyword { }
116
134
/// [Reference]: ../reference/items/extern-crates.html
117
135
mod crate_keyword { }
118
136
137
+ #[ doc( keyword = "else" ) ]
138
+ //
139
+ /// What to do when an [`if`] condition does not hold.
140
+ ///
141
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
142
+ ///
143
+ /// [`if`]: keyword.if.html
144
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
145
+ mod else_keyword { }
146
+
119
147
#[ doc( keyword = "enum" ) ]
120
148
//
121
- /// For defining enumerations .
149
+ /// A type that can be any one of several variants .
122
150
///
123
151
/// Enums in Rust are similar to those of other compiled languages like C, but have important
124
152
/// differences that make them considerably more powerful. What Rust calls enums are more commonly
125
- /// known as [Algebraic Data Types] if you're coming from a functional programming background. The
126
- /// important detail is that each enum variant can have data to go along with it.
153
+ /// known as [Algebraic Data Types][ADT] if you're coming from a functional programming background.
154
+ /// The important detail is that each enum variant can have data to go along with it.
127
155
///
128
156
/// ```rust
129
157
/// # struct Coord;
@@ -166,15 +194,15 @@ mod crate_keyword { }
166
194
///
167
195
/// For more information, take a look at the [Rust Book] or the [Reference]
168
196
///
169
- /// [Algebraic Data Types ]: https://en.wikipedia.org/wiki/Algebraic_data_type
197
+ /// [ADT ]: https://en.wikipedia.org/wiki/Algebraic_data_type
170
198
/// [`Option`]: option/enum.Option.html
171
199
/// [Rust Book]: ../book/ch06-01-defining-an-enum.html
172
200
/// [Reference]: ../reference/items/enumerations.html
173
201
mod enum_keyword { }
174
202
175
203
#[ doc( keyword = "extern" ) ]
176
204
//
177
- /// For external connections in Rust code.
205
+ /// Link to or import external code.
178
206
///
179
207
/// The `extern` keyword is used in two places in Rust. One is in conjunction with the [`crate`]
180
208
/// keyword to make your Rust code aware of other Rust crates in your project, i.e., `extern crate
@@ -214,9 +242,19 @@ mod enum_keyword { }
214
242
/// [Reference]: ../reference/items/external-blocks.html
215
243
mod extern_keyword { }
216
244
245
+ #[ doc( keyword = "false" ) ]
246
+ //
247
+ /// A value of type [`bool`] representing logical **false**.
248
+ ///
249
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
250
+ ///
251
+ /// [`bool`]: primitive.bool.html
252
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
253
+ mod false_keyword { }
254
+
217
255
#[ doc( keyword = "fn" ) ]
218
256
//
219
- /// The keyword for defining functions .
257
+ /// A function or function pointer .
220
258
///
221
259
/// Functions are the primary way code is executed within Rust. Function blocks, usually just
222
260
/// called functions, can be defined in a variety of different places and be assigned many
@@ -283,7 +321,8 @@ mod fn_keyword { }
283
321
284
322
#[ doc( keyword = "for" ) ]
285
323
//
286
- /// The `for` keyword.
324
+ /// Iteration with [`in`], trait implementation with [`impl`], or [higher-ranked trait bounds]
325
+ /// (`for<'a>`).
287
326
///
288
327
/// The `for` keyword is used in many syntactic locations:
289
328
///
@@ -350,6 +389,7 @@ mod fn_keyword { }
350
389
///
351
390
/// For more information on for-loops, see the [Rust book] or the [Reference].
352
391
///
392
+ /// [`in`]: keyword.in.html
353
393
/// [`impl`]: keyword.impl.html
354
394
/// [higher-ranked trait bounds]: ../reference/trait-bounds.html#higher-ranked-trait-bounds
355
395
/// [`IntoIterator`]: iter/trait.IntoIterator.html
@@ -360,7 +400,7 @@ mod for_keyword { }
360
400
361
401
#[ doc( keyword = "if" ) ]
362
402
//
363
- /// If statements and expressions .
403
+ /// Evaluate a block if a condition holds .
364
404
///
365
405
/// `if` is a familiar construct to most programmers, and is the main way you'll often do logic in
366
406
/// your code. However, unlike in most languages, `if` blocks can also act as expressions.
@@ -434,7 +474,7 @@ mod if_keyword { }
434
474
435
475
#[ doc( keyword = "impl" ) ]
436
476
//
437
- /// The implementation-defining keyword .
477
+ /// Implement some functionality for a type .
438
478
///
439
479
/// The `impl` keyword is primarily used to define implementations on types. Inherent
440
480
/// implementations are standalone, while trait implementations are used to implement traits for
@@ -495,9 +535,19 @@ mod if_keyword { }
495
535
/// [book2]: ../book/ch10-02-traits.html#returning-types-that-implement-traits
496
536
mod impl_keyword { }
497
537
538
+ #[ doc( keyword = "in" ) ]
539
+ //
540
+ /// Iterate over a series of values with [`for`].
541
+ ///
542
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
543
+ ///
544
+ /// [`for`]: keyword.for.html
545
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
546
+ mod in_keyword { }
547
+
498
548
#[ doc( keyword = "let" ) ]
499
549
//
500
- /// The variable binding keyword .
550
+ /// Bind a value to a variable .
501
551
///
502
552
/// The primary use for the `let` keyword is in `let` statements, which are used to introduce a new
503
553
/// set of variables into the current scope, as given by a pattern.
@@ -560,7 +610,7 @@ mod let_keyword { }
560
610
561
611
#[ doc( keyword = "loop" ) ]
562
612
//
563
- /// The loop-defining keyword .
613
+ /// Loop indefinitely .
564
614
///
565
615
/// `loop` is used to define the simplest kind of loop supported in Rust. It runs the code inside
566
616
/// it until the code uses `break` or the program exits.
@@ -603,9 +653,104 @@ mod let_keyword { }
603
653
/// [Reference]: ../reference/expressions/loop-expr.html
604
654
mod loop_keyword { }
605
655
656
+ #[ doc( keyword = "match" ) ]
657
+ //
658
+ /// Control flow based on pattern matching.
659
+ ///
660
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
661
+ ///
662
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
663
+ mod match_keyword { }
664
+
665
+ #[ doc( keyword = "mod" ) ]
666
+ //
667
+ /// Organize code into [modules].
668
+ ///
669
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
670
+ ///
671
+ /// [modules]: ../reference/items/modules.html
672
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
673
+ mod mod_keyword { }
674
+
675
+ #[ doc( keyword = "move" ) ]
676
+ //
677
+ /// Capture a [closure]'s environment by value.
678
+ ///
679
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
680
+ ///
681
+ /// [closure]: ../book/second-edition/ch13-01-closures.html
682
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
683
+ mod move_keyword { }
684
+
685
+ #[ doc( keyword = "mut" ) ]
686
+ //
687
+ /// A mutable binding, reference, or pointer.
688
+ ///
689
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
690
+ ///
691
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
692
+ mod mut_keyword { }
693
+
694
+ #[ doc( keyword = "pub" ) ]
695
+ //
696
+ /// Make an item visible to others.
697
+ ///
698
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
699
+ ///
700
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
701
+ mod pub_keyword { }
702
+
703
+ #[ doc( keyword = "ref" ) ]
704
+ //
705
+ /// Bind by reference during pattern matching.
706
+ ///
707
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
708
+ ///
709
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
710
+ mod ref_keyword { }
711
+
712
+ #[ doc( keyword = "return" ) ]
713
+ //
714
+ /// Return a value from a function.
715
+ ///
716
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
717
+ ///
718
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
719
+ mod return_keyword { }
720
+
721
+ #[ doc( keyword = "self" ) ]
722
+ //
723
+ /// The receiver of a method, or the current module.
724
+ ///
725
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
726
+ ///
727
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
728
+ mod self_keyword { }
729
+
730
+ #[ doc( keyword = "Self" ) ]
731
+ //
732
+ /// The implementing type within a [`trait`] or [`impl`] block, or the current type within a type
733
+ /// definition.
734
+ ///
735
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
736
+ ///
737
+ /// [`impl`]: keyword.impl.html
738
+ /// [`trait`]: keyword.trait.html
739
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
740
+ mod self_upper_keyword { }
741
+
742
+ #[ doc( keyword = "static" ) ]
743
+ //
744
+ /// A place that is valid for the duration of a program.
745
+ ///
746
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
747
+ ///
748
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
749
+ mod static_keyword { }
750
+
606
751
#[ doc( keyword = "struct" ) ]
607
752
//
608
- /// The keyword used to define structs .
753
+ /// A type that is composed of other types .
609
754
///
610
755
/// Structs in Rust come in three flavors: Structs with named fields, tuple structs, and unit
611
756
/// structs.
@@ -710,3 +855,122 @@ mod loop_keyword { }
710
855
/// [book]: ../book/ch05-01-defining-structs.html
711
856
/// [reference]: ../reference/items/structs.html
712
857
mod struct_keyword { }
858
+
859
+ #[ doc( keyword = "super" ) ]
860
+ //
861
+ /// The parent of the current [module].
862
+ ///
863
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
864
+ ///
865
+ /// [module]: ../reference/items/modules.html
866
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
867
+ mod super_keyword { }
868
+
869
+ #[ doc( keyword = "trait" ) ]
870
+ //
871
+ /// A common interface for a class of types.
872
+ ///
873
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
874
+ ///
875
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
876
+ mod trait_keyword { }
877
+
878
+ #[ doc( keyword = "true" ) ]
879
+ //
880
+ /// A value of type [`bool`] representing logical **true**.
881
+ ///
882
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
883
+ ///
884
+ /// [`bool`]: primitive.bool.html
885
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
886
+ mod true_keyword { }
887
+
888
+ #[ doc( keyword = "type" ) ]
889
+ //
890
+ /// Define an alias for an existing type.
891
+ ///
892
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
893
+ ///
894
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
895
+ mod type_keyword { }
896
+
897
+ #[ doc( keyword = "unsafe" ) ]
898
+ //
899
+ /// Code or interfaces whose [memory safety] cannot be verified by the type system.
900
+ ///
901
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
902
+ ///
903
+ /// [memory safety]: ../book/ch19-01-unsafe-rust.html
904
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
905
+ mod unsafe_keyword { }
906
+
907
+ #[ doc( keyword = "use" ) ]
908
+ //
909
+ /// Import or rename items from other crates or modules.
910
+ ///
911
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
912
+ ///
913
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
914
+ mod use_keyword { }
915
+
916
+ #[ doc( keyword = "where" ) ]
917
+ //
918
+ /// Add constraints that must be upheld to use an item.
919
+ ///
920
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
921
+ ///
922
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
923
+ mod where_keyword { }
924
+
925
+ #[ doc( keyword = "while" ) ]
926
+ //
927
+ /// Loop while a condition is upheld.
928
+ ///
929
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
930
+ ///
931
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
932
+ mod while_keyword { }
933
+
934
+ // 2018 Edition keywords
935
+
936
+ #[ unstable( feature = "async_await" , issue = "50547" ) ]
937
+ #[ doc( keyword = "async" ) ]
938
+ //
939
+ /// Return a [`Future`] instead of blocking the current thread.
940
+ ///
941
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
942
+ ///
943
+ /// [`Future`]: ./future/trait.Future.html
944
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
945
+ mod async_keyword { }
946
+
947
+ #[ unstable( feature = "async_await" , issue = "50547" ) ]
948
+ #[ doc( keyword = "await" ) ]
949
+ //
950
+ /// Suspend execution until the result of a [`Future`] is ready.
951
+ ///
952
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
953
+ ///
954
+ /// [`Future`]: ./future/trait.Future.html
955
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
956
+ mod await_keyword { }
957
+
958
+ #[ doc( keyword = "dyn" ) ]
959
+ //
960
+ /// Name the type of a [trait object].
961
+ ///
962
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
963
+ ///
964
+ /// [trait object]: ../book/ch17-02-trait-objects.html
965
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
966
+ mod dyn_keyword { }
967
+
968
+ #[ doc( keyword = "union" ) ]
969
+ //
970
+ /// The [Rust equivalent of a C-style union][union].
971
+ ///
972
+ /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
973
+ ///
974
+ /// [union]: ../reference/items/unions.html
975
+ /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
976
+ mod union_keyword { }
0 commit comments