]> git.lizzy.rs Git - rust.git/commitdiff
clean up E0308 explanation
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Thu, 13 Feb 2020 17:41:55 +0000 (18:41 +0100)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Sun, 8 Mar 2020 09:39:41 +0000 (10:39 +0100)
src/librustc_error_codes/error_codes/E0308.md

index a907ca272970e0a3f72ee29cd3f8810f7e36e3ee..7d87d54194e9b7a5e195a2d9e5a7067b9d66affe 100644 (file)
@@ -1,10 +1,6 @@
-This error occurs when the compiler was unable to infer the concrete type of a
-variable. It can occur for several cases, the most common of which is a
-mismatch in the expected type that the compiler inferred for a variable's
-initializing expression, and the actual type explicitly assigned to the
-variable.
+Expected type did not match the received type.
 
-For example:
+Erroneous code example:
 
 ```compile_fail,E0308
 let x: i32 = "I am not a number!";
@@ -15,3 +11,9 @@ let x: i32 = "I am not a number!";
 //      |
 //    type `i32` assigned to variable `x`
 ```
+
+This error occurs when the compiler was unable to infer the concrete type of a
+variable. It can occur for several cases, the most common of which is a
+mismatch in the expected type that the compiler inferred for a variable's
+initializing expression, and the actual type explicitly assigned to the
+variable.