From: Guillaume Gomez Date: Fri, 15 Nov 2019 12:21:50 +0000 (+0100) Subject: Clean up E0054 X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=041c9f6f48ee5f145d268b324d4be83013fb6754;p=rust.git Clean up E0054 --- 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;