]> git.lizzy.rs Git - rust.git/commitdiff
Clean up E0054
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Fri, 15 Nov 2019 12:21:50 +0000 (13:21 +0100)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Fri, 15 Nov 2019 12:24:47 +0000 (13:24 +0100)
src/librustc_error_codes/error_codes/E0054.md

index af71cb44462a69dc7ae7b2b40afce598922a02ba..c3eb375fbcc9a07e066a7af1ce3803346d81611c 100644 (file)
@@ -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;