diff options
| author | Georg Brandl <georg@python.org> | 2015-08-20 07:23:15 +0200 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2015-08-20 07:23:29 +0200 |
| commit | 9d7c84d3b8e6b275be378cdfdec2033b3bdcea6d (patch) | |
| tree | 159d4059d620a14290ff43d4517db8673025258c | |
| parent | aca2057ed5fb7af3f8905b2bc01f72fa001c35c8 (diff) | |
| download | rust-9d7c84d3b8e6b275be378cdfdec2033b3bdcea6d.tar.gz rust-9d7c84d3b8e6b275be378cdfdec2033b3bdcea6d.zip | |
syntax: remove suffix_len methods from LitIntTypes
The methods gave wrong results for TyIs and TyUs, whose suffix len should be 5 nowadays. But since they were only used for parsing, and unneeded for that since 606a309d, remove them rather than fixing.
| -rw-r--r-- | src/libsyntax/ast.rs | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 2d72c8fe2a4..cd0705f543b 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1216,16 +1216,6 @@ pub enum LitIntType { UnsuffixedIntLit(Sign) } -impl LitIntType { - pub fn suffix_len(&self) -> usize { - match *self { - UnsuffixedIntLit(_) => 0, - SignedIntLit(s, _) => s.suffix_len(), - UnsignedIntLit(u) => u.suffix_len() - } - } -} - #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum Lit_ { /// A string literal (`"foo"`) @@ -1333,12 +1323,6 @@ impl fmt::Display for IntTy { } impl IntTy { - pub fn suffix_len(&self) -> usize { - match *self { - TyIs | TyI8 => 2, - TyI16 | TyI32 | TyI64 => 3, - } - } pub fn bit_width(&self) -> Option<usize> { Some(match *self { TyIs => return None, @@ -1360,12 +1344,6 @@ pub enum UintTy { } impl UintTy { - pub fn suffix_len(&self) -> usize { - match *self { - TyUs | TyU8 => 2, - TyU16 | TyU32 | TyU64 => 3, - } - } pub fn bit_width(&self) -> Option<usize> { Some(match *self { TyUs => return None, @@ -1408,11 +1386,6 @@ impl fmt::Display for FloatTy { } impl FloatTy { - pub fn suffix_len(&self) -> usize { - match *self { - TyF32 | TyF64 => 3, // add F128 handling here - } - } pub fn bit_width(&self) -> usize { match *self { TyF32 => 32, |
