2022-02-06 16:43:51 +08:00
|
|
|
$ cargo run
|
|
|
|
Compiling enums v0.1.0 (file:///projects/enums)
|
|
|
|
error[E0277]: cannot add `Option<i8>` to `i8`
|
|
|
|
--> src/main.rs:5:17
|
|
|
|
|
|
|
|
|
5 | let sum = x + y;
|
|
|
|
| ^ no implementation for `i8 + Option<i8>`
|
|
|
|
|
|
|
|
|
= help: the trait `Add<Option<i8>>` is not implemented for `i8`
|
2023-01-16 17:34:52 +08:00
|
|
|
= help: the following other types implement trait `Add<Rhs>`:
|
2024-10-20 23:44:05 +08:00
|
|
|
`&'a i8` implements `Add<i8>`
|
|
|
|
`&i8` implements `Add<&i8>`
|
|
|
|
`i8` implements `Add<&i8>`
|
|
|
|
`i8` implements `Add`
|
2022-02-06 16:43:51 +08:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|
2024-06-06 21:23:21 +08:00
|
|
|
error: could not compile `enums` (bin "enums") due to 1 previous error
|