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
964 B
Rust
Raw Normal View History

struct A;
fn main() {
let a = A;
2019-12-11 16:11:32 -06: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 16:11:32 -06:00
a / a; //~ ERROR cannot divide `A` by `A`
a % a; //~ ERROR cannot calculate the remainder of `A` divided by `A`
2019-12-11 16:11:32 -06:00
a & a; //~ ERROR no implementation for `A & A`
2019-12-11 16:11:32 -06:00
a | a; //~ ERROR no implementation for `A | A`
2019-12-11 16:11:32 -06:00
a << a; //~ ERROR no implementation for `A << A`
2019-12-11 16:11:32 -06: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`
}