about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustc_error_codes/error_codes')
-rw-r--r--src/librustc_error_codes/error_codes/E0054.md8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/librustc_error_codes/error_codes/E0054.md b/src/librustc_error_codes/error_codes/E0054.md
index af71cb44462..c3eb375fbcc 100644
--- a/src/librustc_error_codes/error_codes/E0054.md
+++ b/src/librustc_error_codes/error_codes/E0054.md
@@ -1,5 +1,6 @@
-It is not allowed to cast to a bool. If you are trying to cast a numeric type
-to a bool, you can compare it with zero instead:
+It is not allowed to cast to a bool.
+
+Erroneous code example:
 
 ```compile_fail,E0054
 let x = 5;
@@ -8,6 +9,9 @@ let x = 5;
 let x_is_nonzero = x as bool;
 ```
 
+If you are trying to cast a numeric type to a bool, you can compare it with
+zero instead:
+
 ```
 let x = 5;