|
| 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 | + |
| 11 | +struct A; |
| 12 | + |
| 13 | +fn main() { |
| 14 | + let a = A; |
| 15 | + |
| 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` |
| 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` |
| 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` |
| 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` |
| 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` |
| 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` |
| 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` |
| 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` |
| 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` |
| 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` |
| 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` |
| 48 | + |
| 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` |
| 51 | + |
| 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` |
| 54 | + |
| 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` |
| 57 | + |
| 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` |
| 60 | +} |
0 commit comments