|
| 1 | +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT |
| 2 | +// file at the top-level directory of this distribution and at |
| 3 | +// http://rust-lang.org/COPYRIGHT. |
| 4 | +// |
| 5 | +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 6 | +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 7 | +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
| 8 | +// option. This file may not be copied, modified, or distributed |
| 9 | +// except according to those terms. |
| 10 | + |
1 | 11 | struct A;
|
2 | 12 |
|
3 | 13 | fn main() {
|
4 | 14 | let a = A;
|
5 | 15 |
|
6 |
| - if a == a {} //~ ERROR binary operation `==` cannot be applied to type `A` |
7 |
| - //^~ NOTE an implementation of `std::cmp::PartialEq` might be missing for `A` or one of |
| 16 | + a + a; //~ ERROR binary operation `+` cannot be applied to type `A` |
| 17 | + //~^ NOTE an implementation of `std::ops::Add` might be missing for `A` or |
| 18 | + |
| 19 | + a - a; //~ ERROR binary operation `-` cannot be applied to type `A` |
| 20 | + //~^ NOTE an implementation of `std::ops::Sub` might be missing for `A` or one of |
| 21 | + |
| 22 | + a * a; //~ ERROR binary operation `*` cannot be applied to type `A` |
| 23 | + //~^ NOTE an implementation of `std::ops::Mul` might be missing for `A` or one of |
| 24 | + |
| 25 | + a / a; //~ ERROR binary operation `/` cannot be applied to type `A` |
| 26 | + //~^ NOTE an implementation of `std::ops::Div` might be missing for `A` or one of |
| 27 | + |
| 28 | + a % a; //~ ERROR binary operation `%` cannot be applied to type `A` |
| 29 | + //~^ NOTE an implementation of `std::ops::Rem` might be missing for `A` or one of |
| 30 | + |
| 31 | + a & a; //~ ERROR binary operation `&` cannot be applied to type `A` |
| 32 | + //~^ NOTE an implementation of `std::ops::BitAnd` might be missing for `A` or one of |
| 33 | + |
| 34 | + a | a; //~ ERROR binary operation `|` cannot be applied to type `A` |
| 35 | + //~^ NOTE an implementation of `std::ops::BitOr` might be missing for `A` or one of |
| 36 | + |
| 37 | + a << a; //~ ERROR binary operation `<<` cannot be applied to type `A` |
| 38 | + //~^ NOTE an implementation of `std::ops::Shl` might be missing for `A` or one of |
| 39 | + |
| 40 | + a >> a; //~ ERROR binary operation `>>` cannot be applied to type `A` |
| 41 | + //~^ NOTE an implementation of `std::ops::Shr` might be missing for `A` or one of |
| 42 | + |
| 43 | + a == a; //~ ERROR binary operation `==` cannot be applied to type `A` |
| 44 | + //~^ NOTE an implementation of `std::cmp::PartialEq` might be missing for `A` or one of |
| 45 | + |
| 46 | + a != a; //~ ERROR binary operation `!=` cannot be applied to type `A` |
| 47 | + //~^ NOTE an implementation of `std::cmp::PartialEq` might be missing for `A` or one of |
8 | 48 |
|
9 |
| - if a < a {} //~ ERROR binary operation `<` cannot be applied to type `A` |
10 |
| - //^~ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of |
| 49 | + a < a; //~ ERROR binary operation `<` cannot be applied to type `A` |
| 50 | + //~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of |
11 | 51 |
|
12 |
| - if a <= a {} //~ ERROR binary operation `<=` cannot be applied to type `A` |
13 |
| - //^~ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of |
| 52 | + a <= a; //~ ERROR binary operation `<=` cannot be applied to type `A` |
| 53 | + //~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of |
14 | 54 |
|
15 |
| - if a > a {} //~ ERROR binary operation `>` cannot be applied to type `A` |
16 |
| - //^~ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of |
| 55 | + a > a; //~ ERROR binary operation `>` cannot be applied to type `A` |
| 56 | + //~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of |
17 | 57 |
|
18 |
| - if a >= a {} //~ ERROR binary operation `>=` cannot be applied to type `A` |
19 |
| - //^~ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of |
| 58 | + a >= a; //~ ERROR binary operation `>=` cannot be applied to type `A` |
| 59 | + //~^ NOTE an implementation of `std::cmp::PartialOrd` might be missing for `A` or one of |
20 | 60 | }
|
0 commit comments