rust/src/test/ui/issues/issue-28837.rs

36 lines
1.1 KiB
Rust
Raw Normal View History

struct A;
fn main() {
let a = A;
a + a; //~ ERROR binary operation `+` cannot be applied to type `A`
a - a; //~ ERROR binary operation `-` cannot be applied to type `A`
a * a; //~ ERROR binary operation `*` cannot be applied to type `A`
a / a; //~ ERROR binary operation `/` cannot be applied to type `A`
a % a; //~ ERROR binary operation `%` cannot be applied to type `A`
a & a; //~ ERROR binary operation `&` cannot be applied to type `A`
a | a; //~ ERROR binary operation `|` cannot be applied to type `A`
a << a; //~ ERROR binary operation `<<` cannot be applied to type `A`
a >> a; //~ ERROR binary operation `>>` cannot be applied to type `A`
a == a; //~ ERROR binary operation `==` cannot be applied to type `A`
a != a; //~ ERROR binary operation `!=` cannot be applied to type `A`
a < a; //~ ERROR binary operation `<` cannot be applied to type `A`
a <= a; //~ ERROR binary operation `<=` cannot be applied to type `A`
a > a; //~ ERROR binary operation `>` cannot be applied to type `A`
a >= a; //~ ERROR binary operation `>=` cannot be applied to type `A`
}