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

36 lines
934 B
Rust
Raw Normal View History

struct A;
fn main() {
let a = A;
2019-12-11 23:11:32 +01:00
a + a; //~ ERROR cannot add `A` to `A`
2019-12-11 23:11:32 +01:00
a - a; //~ ERROR cannot substract `A` from `A`
2019-12-11 23:11:32 +01:00
a * a; //~ ERROR cannot multiply `A` to `A`
2019-12-11 23:11:32 +01:00
a / a; //~ ERROR cannot divide `A` by `A`
2019-12-11 23:11:32 +01:00
a % a; //~ ERROR cannot mod `A` by `A`
2019-12-11 23:11:32 +01:00
a & a; //~ ERROR no implementation for `A & A`
2019-12-11 23:11:32 +01:00
a | a; //~ ERROR no implementation for `A | A`
2019-12-11 23:11:32 +01:00
a << a; //~ ERROR no implementation for `A << A`
2019-12-11 23:11:32 +01:00
a >> a; //~ ERROR no implementation for `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`
}