Skip to content

Commit 57f1bb1

Browse files
clean up E0308 explanation
1 parent 823ff8c commit 57f1bb1

File tree

1 file changed

+8
-6
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+8
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
This error occurs when the compiler was unable to infer the concrete type of a
2-
variable. It can occur for several cases, the most common of which is a
3-
mismatch in the expected type that the compiler inferred for a variable's
4-
initializing expression, and the actual type explicitly assigned to the
5-
variable.
1+
Expected type did not match the received type.
62

7-
For example:
3+
Erroneous code example:
84

95
```compile_fail,E0308
106
let x: i32 = "I am not a number!";
@@ -15,3 +11,9 @@ let x: i32 = "I am not a number!";
1511
// |
1612
// type `i32` assigned to variable `x`
1713
```
14+
15+
This error occurs when the compiler was unable to infer the concrete type of a
16+
variable. It can occur for several cases, the most common of which is a
17+
mismatch in the expected type that the compiler inferred for a variable's
18+
initializing expression, and the actual type explicitly assigned to the
19+
variable.

0 commit comments

Comments
 (0)