From 4fd418652010320defe556ba9a1b3a4a767098db Mon Sep 17 00:00:00 2001 From: mcc Date: Tue, 16 Mar 2021 18:04:45 -0400 Subject: [PATCH 1/2] Explicitly note any cast not defined in the documentation is illegal. --- src/expressions/operator-expr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expressions/operator-expr.md b/src/expressions/operator-expr.md index 73284bb78..c33488c55 100644 --- a/src/expressions/operator-expr.md +++ b/src/expressions/operator-expr.md @@ -305,7 +305,7 @@ fn average(values: &[f64]) -> f64 { } ``` -`as` can be used to explicitly perform [coercions](../type-coercions.md), as well as the following additional casts. +`as` can be used to explicitly perform [coercions](../type-coercions.md), as well as the following additional casts. Any cast that does not fit either a coercion rule or an entry in the table is a compiler error. Here `*T` means either `*const T` or `*mut T`. | Type of `e` | `U` | Cast performed by `e as U` | From 3b3a6a52a66132349cf04eb3e29f1771fdf3df2a Mon Sep 17 00:00:00 2001 From: Ryan Scheel Date: Tue, 16 Mar 2021 19:22:26 -0700 Subject: [PATCH 2/2] Style fix --- src/expressions/operator-expr.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/expressions/operator-expr.md b/src/expressions/operator-expr.md index c33488c55..e75ce885a 100644 --- a/src/expressions/operator-expr.md +++ b/src/expressions/operator-expr.md @@ -305,7 +305,8 @@ fn average(values: &[f64]) -> f64 { } ``` -`as` can be used to explicitly perform [coercions](../type-coercions.md), as well as the following additional casts. Any cast that does not fit either a coercion rule or an entry in the table is a compiler error. +`as` can be used to explicitly perform [coercions](../type-coercions.md), as well as the following additional casts. +Any cast that does not fit either a coercion rule or an entry in the table is a compiler error. Here `*T` means either `*const T` or `*mut T`. | Type of `e` | `U` | Cast performed by `e as U` |