]> git.lizzy.rs Git - rust.git/blob - src/librustc/ich/impls_const_math.rs
6d11f2a87a413485ceb97bbaf6cdb2ebc4b8caf4
[rust.git] / src / librustc / ich / impls_const_math.rs
1 // Copyright 2017 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 //! This module contains `HashStable` implementations for various data types
12 //! from `rustc_const_math` in no particular order.
13
14 impl_stable_hash_for!(enum ::rustc_const_math::ConstFloat {
15     F32(val),
16     F64(val)
17 });
18
19 impl_stable_hash_for!(enum ::rustc_const_math::ConstInt {
20     I8(val),
21     I16(val),
22     I32(val),
23     I64(val),
24     I128(val),
25     Isize(val),
26     U8(val),
27     U16(val),
28     U32(val),
29     U64(val),
30     U128(val),
31     Usize(val)
32 });
33
34 impl_stable_hash_for!(enum ::rustc_const_math::ConstIsize {
35     Is16(i16),
36     Is32(i32),
37     Is64(i64)
38 });
39
40 impl_stable_hash_for!(enum ::rustc_const_math::ConstUsize {
41     Us16(i16),
42     Us32(i32),
43     Us64(i64)
44 });
45
46 impl_stable_hash_for!(enum ::rustc_const_math::ConstMathErr {
47     NotInRange,
48     CmpBetweenUnequalTypes,
49     UnequalTypes(op),
50     Overflow(op),
51     ShiftNegative,
52     DivisionByZero,
53     RemainderByZero,
54     UnsignedNegation,
55     ULitOutOfRange(int_ty),
56     LitOutOfRange(int_ty)
57 });
58
59 impl_stable_hash_for!(enum ::rustc_const_math::Op {
60     Add,
61     Sub,
62     Mul,
63     Div,
64     Rem,
65     Shr,
66     Shl,
67     Neg,
68     BitAnd,
69     BitOr,
70     BitXor
71 });