From 041c9f6f48ee5f145d268b324d4be83013fb6754 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 15 Nov 2019 13:21:50 +0100 Subject: Clean up E0054 --- src/librustc_error_codes/error_codes/E0054.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/librustc_error_codes/error_codes') 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; -- cgit 1.4.1-3-g733a5