]> git.proxmox.com Git - rustc.git/blobdiff - src/librustc_error_codes/error_codes/E0308.md
New upstream version 1.44.1+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0308.md
index a907ca272970e0a3f72ee29cd3f8810f7e36e3ee..b2c8437049001950fc5f8b16698c88076392788b 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 happen in several cases, the most common being a mismatch
+between the type that the compiler inferred for a variable based on its
+initializing expression, on the one hand, and the type the author explicitly
+assigned to the variable, on the other hand.