Closed
Description
From the new book.
let x: i8 = 5;
let y: Option<i8> = Some(5);
let sum = x + y;
If we run this code, we get an error message like this:
error[E0277]: the trait bound `i8: std::ops::Add<std::option::Option<i8>>` is not satisfied
-->
|
7 | let sum = x + y;
| ^^^^^
|
This error could be a lot more newbie friendly. The next section of the book even has to apologize and explain:
"Intense! What this error message is trying to say is that Rust does not understand how to add an Option and an i8, since they're different types."
cc @jonathandturner @rust-lang/docs