diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-02-13 18:41:55 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-03-08 10:39:41 +0100 |
| commit | 57f1bb15b3f0d2fdd737804c7b7821fe1b40e256 (patch) | |
| tree | 344cbf472077a591356866cdef601fbcca8f3efd /src/librustc_error_codes | |
| parent | 823ff8cf1397a5772b1f6954b60576202bf91836 (diff) | |
| download | rust-57f1bb15b3f0d2fdd737804c7b7821fe1b40e256.tar.gz rust-57f1bb15b3f0d2fdd737804c7b7821fe1b40e256.zip | |
clean up E0308 explanation
Diffstat (limited to 'src/librustc_error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0308.md | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/librustc_error_codes/error_codes/E0308.md b/src/librustc_error_codes/error_codes/E0308.md index a907ca27297..7d87d54194e 100644 --- a/src/librustc_error_codes/error_codes/E0308.md +++ b/src/librustc_error_codes/error_codes/E0308.md @@ -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. |
