1 // Copyright 2012 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.
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.
11 //! Traits for the built-in operators
13 #[allow(missing_doc)];
21 pub trait Add<RHS,Result> {
22 fn add(&self, rhs: &RHS) -> Result;
26 pub trait Sub<RHS,Result> {
27 fn sub(&self, rhs: &RHS) -> Result;
31 pub trait Mul<RHS,Result> {
32 fn mul(&self, rhs: &RHS) -> Result;
36 pub trait Div<RHS,Result> {
37 fn div(&self, rhs: &RHS) -> Result;
41 pub trait Rem<RHS,Result> {
42 fn rem(&self, rhs: &RHS) -> Result;
46 pub trait Neg<Result> {
47 fn neg(&self) -> Result;
51 pub trait Not<Result> {
52 fn not(&self) -> Result;
56 pub trait BitAnd<RHS,Result> {
57 fn bitand(&self, rhs: &RHS) -> Result;
61 pub trait BitOr<RHS,Result> {
62 fn bitor(&self, rhs: &RHS) -> Result;
66 pub trait BitXor<RHS,Result> {
67 fn bitxor(&self, rhs: &RHS) -> Result;
71 pub trait Shl<RHS,Result> {
72 fn shl(&self, rhs: &RHS) -> Result;
76 pub trait Shr<RHS,Result> {
77 fn shr(&self, rhs: &RHS) -> Result;
81 pub trait Index<Index,Result> {
82 fn index(&self, index: &Index) -> Result;
88 use extra::test::BenchHarness;
97 impl Drop for HasDtor {
103 fn alloc_obj_with_dtor(bh: &mut BenchHarness) {