Skip to content

Commit 258f303

Browse files
committed
Auto merge of #27913 - birkenfeld:remove_suffix_len, r=alexcrichton
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 606a309, remove them rather than fixing. I hope this is ok to do, since all of rustc is considered unstable...
2 parents bc4df4c + 9d7c84d commit 258f303

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

src/libsyntax/ast.rs

-27
Original file line numberDiff line numberDiff line change
@@ -1216,16 +1216,6 @@ pub enum LitIntType {
12161216
UnsuffixedIntLit(Sign)
12171217
}
12181218

1219-
impl LitIntType {
1220-
pub fn suffix_len(&self) -> usize {
1221-
match *self {
1222-
UnsuffixedIntLit(_) => 0,
1223-
SignedIntLit(s, _) => s.suffix_len(),
1224-
UnsignedIntLit(u) => u.suffix_len()
1225-
}
1226-
}
1227-
}
1228-
12291219
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
12301220
pub enum Lit_ {
12311221
/// A string literal (`"foo"`)
@@ -1333,12 +1323,6 @@ impl fmt::Display for IntTy {
13331323
}
13341324

13351325
impl IntTy {
1336-
pub fn suffix_len(&self) -> usize {
1337-
match *self {
1338-
TyIs | TyI8 => 2,
1339-
TyI16 | TyI32 | TyI64 => 3,
1340-
}
1341-
}
13421326
pub fn bit_width(&self) -> Option<usize> {
13431327
Some(match *self {
13441328
TyIs => return None,
@@ -1360,12 +1344,6 @@ pub enum UintTy {
13601344
}
13611345

13621346
impl UintTy {
1363-
pub fn suffix_len(&self) -> usize {
1364-
match *self {
1365-
TyUs | TyU8 => 2,
1366-
TyU16 | TyU32 | TyU64 => 3,
1367-
}
1368-
}
13691347
pub fn bit_width(&self) -> Option<usize> {
13701348
Some(match *self {
13711349
TyUs => return None,
@@ -1408,11 +1386,6 @@ impl fmt::Display for FloatTy {
14081386
}
14091387

14101388
impl FloatTy {
1411-
pub fn suffix_len(&self) -> usize {
1412-
match *self {
1413-
TyF32 | TyF64 => 3, // add F128 handling here
1414-
}
1415-
}
14161389
pub fn bit_width(&self) -> usize {
14171390
match *self {
14181391
TyF32 => 32,

0 commit comments

Comments
 (0)