Skip to main content

E0006: Binary Operator Type Mismatch

The operands of a binary operator don't have matching or compatible types.

Example

fn main() {
let x = 5 + true; // Error: binary `+` operands must match; found `i64` and `bool`
}

How to fix

Ensure both operands have the same type:

fn main() {
let x = 5 + 10; // OK: both are i64
let y = true && false; // OK: both are bool
}