diff options
| author | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2016-02-11 09:52:55 +0100 |
|---|---|---|
| committer | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2016-02-11 12:34:48 +0100 |
| commit | bfa66bb389ce1c7ce4aff09d1842b3428015bd4d (patch) | |
| tree | f6252627aac7945dec962bacb43ed50186c8ab9b /src/libsyntax/ast.rs | |
| parent | 625e78b7001c6e20f29928a5da8c9d21e9aed6c5 (diff) | |
| download | rust-bfa66bb389ce1c7ce4aff09d1842b3428015bd4d.tar.gz rust-bfa66bb389ce1c7ce4aff09d1842b3428015bd4d.zip | |
[breaking-change] remove the sign from integer literals in the ast
Diffstat (limited to 'src/libsyntax/ast.rs')
| -rw-r--r-- | src/libsyntax/ast.rs | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index dbc73f01bc2..464e9da3724 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -21,7 +21,6 @@ pub use self::Mutability::*; pub use self::Pat_::*; pub use self::PathListItem_::*; pub use self::PrimTy::*; -pub use self::Sign::*; pub use self::Stmt_::*; pub use self::StrStyle::*; pub use self::StructFieldKind::*; @@ -1270,35 +1269,10 @@ pub enum StrStyle { pub type Lit = Spanned<Lit_>; #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] -pub enum Sign { - Minus, - Plus -} - -impl Sign { - pub fn new<T: IntSign>(n: T) -> Sign { - n.sign() - } -} - -pub trait IntSign { - fn sign(&self) -> Sign; -} -macro_rules! doit { - ($($t:ident)*) => ($(impl IntSign for $t { - #[allow(unused_comparisons)] - fn sign(&self) -> Sign { - if *self < 0 {Minus} else {Plus} - } - })*) -} -doit! { i8 i16 i32 i64 isize u8 u16 u32 u64 usize } - -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] pub enum LitIntType { - SignedIntLit(IntTy, Sign), + SignedIntLit(IntTy), UnsignedIntLit(UintTy), - UnsuffixedIntLit(Sign) + UnsuffixedIntLit, } #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] |
