rust/tests/ui/binop/issue-28837.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
933 B
Rust
Raw Normal View History

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