@@ -167,13 +167,6 @@ pub enum GenericArgs {
167
167
}
168
168
169
169
impl GenericArgs {
170
- pub fn is_parenthesized ( & self ) -> bool {
171
- match * self {
172
- Parenthesized ( ..) => true ,
173
- _ => false ,
174
- }
175
- }
176
-
177
170
pub fn is_angle_bracketed ( & self ) -> bool {
178
171
match * self {
179
172
AngleBracketed ( ..) => true ,
@@ -857,13 +850,6 @@ impl BinOpKind {
857
850
}
858
851
}
859
852
860
- pub fn is_shift ( & self ) -> bool {
861
- match * self {
862
- BinOpKind :: Shl | BinOpKind :: Shr => true ,
863
- _ => false ,
864
- }
865
- }
866
-
867
853
pub fn is_comparison ( & self ) -> bool {
868
854
use BinOpKind :: * ;
869
855
// Note for developers: please keep this as is;
@@ -873,11 +859,6 @@ impl BinOpKind {
873
859
And | Or | Add | Sub | Mul | Div | Rem | BitXor | BitAnd | BitOr | Shl | Shr => false ,
874
860
}
875
861
}
876
-
877
- /// Returns `true` if the binary operator takes its arguments by value
878
- pub fn is_by_value ( & self ) -> bool {
879
- !self . is_comparison ( )
880
- }
881
862
}
882
863
883
864
pub type BinOp = Spanned < BinOpKind > ;
@@ -896,14 +877,6 @@ pub enum UnOp {
896
877
}
897
878
898
879
impl UnOp {
899
- /// Returns `true` if the unary operator takes its argument by value
900
- pub fn is_by_value ( u : UnOp ) -> bool {
901
- match u {
902
- UnOp :: Neg | UnOp :: Not => true ,
903
- _ => false ,
904
- }
905
- }
906
-
907
880
pub fn to_string ( op : UnOp ) -> & ' static str {
908
881
match op {
909
882
UnOp :: Deref => "*" ,
@@ -1753,13 +1726,6 @@ impl IntTy {
1753
1726
}
1754
1727
}
1755
1728
1756
- pub fn val_to_string ( & self , val : i128 ) -> String {
1757
- // Cast to a `u128` so we can correctly print `INT128_MIN`. All integral types
1758
- // are parsed as `u128`, so we wouldn't want to print an extra negative
1759
- // sign.
1760
- format ! ( "{}{}" , val as u128 , self . name_str( ) )
1761
- }
1762
-
1763
1729
pub fn bit_width ( & self ) -> Option < u64 > {
1764
1730
Some ( match * self {
1765
1731
IntTy :: Isize => return None ,
@@ -1818,10 +1784,6 @@ impl UintTy {
1818
1784
}
1819
1785
}
1820
1786
1821
- pub fn val_to_string ( & self , val : u128 ) -> String {
1822
- format ! ( "{}{}" , val, self . name_str( ) )
1823
- }
1824
-
1825
1787
pub fn bit_width ( & self ) -> Option < u64 > {
1826
1788
Some ( match * self {
1827
1789
UintTy :: Usize => return None ,
0 commit comments