rust/src/test/compile-fail/issue-28837.rs

21 lines
920 B
Rust
Raw Normal View History

struct A;
fn main() {
let a = A;
if a == a {} //~ ERROR binary operation `==` cannot be applied to type `A`
//^~ NOTE an implementation of `std::cmp::PartialEq` might be missing for `A` or one of
if a < a {} //~ ERROR binary operation `<` cannot be applied to type `A`
//^~ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of
if a <= a {} //~ ERROR binary operation `<=` cannot be applied to type `A`
//^~ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of
if a > a {} //~ ERROR binary operation `>` cannot be applied to type `A`
//^~ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of
if a >= a {} //~ ERROR binary operation `>=` cannot be applied to type `A`
//^~ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of
}