diff --git a/doc/keywords.txt b/doc/keywords.txt index eb559f0d5f9..de138eb2a10 100644 --- a/doc/keywords.txt +++ b/doc/keywords.txt @@ -17,4 +17,4 @@ self str syntax tag true type u16 u32 u64 u8 uint unchecked unsafe use vec -when while with +while with diff --git a/doc/rust.texi b/doc/rust.texi index 5499ab37470..0ed7748c1f9 100644 --- a/doc/rust.texi +++ b/doc/rust.texi @@ -3331,12 +3331,12 @@ let message = alt x @{ Finally, alt patterns can accept @emph{pattern guards} to further refine the criteria for matching a case. Pattern guards appear after the pattern and -consist of a bool-typed expression following the @emph{when} keyword. A pattern +consist of a bool-typed expression following the @emph{if} keyword. A pattern guard may refer to the variables bound within the pattern they follow. @example let message = alt maybe_digit @{ - some(x) when x < 10 @{ process_digit(x) @} + some(x) if x < 10 @{ process_digit(x) @} some(x) @{ process_other(x) @} @} @end example diff --git a/doc/tutorial/control.md b/doc/tutorial/control.md index 966aeb2df52..fc89218b751 100644 --- a/doc/tutorial/control.md +++ b/doc/tutorial/control.md @@ -67,7 +67,7 @@ that `(float, float)` is a tuple of two floats: fn angle(vec: (float, float)) -> float { alt vec { - (0f, y) when y < 0f { 1.5 * std::math::pi } + (0f, y) if y < 0f { 1.5 * std::math::pi } (0f, y) { 0.5 * std::math::pi } (x, y) { std::math::atan(y / x) } }