File tree Expand file tree Collapse file tree 2 files changed +22
-22
lines changed Expand file tree Collapse file tree 2 files changed +22
-22
lines changed Original file line number Diff line number Diff line change @@ -149,3 +149,25 @@ impl PointerMathType for VectorType {
149
149
type ValueType = VectorValue ;
150
150
type PtrConvType = VectorType ;
151
151
}
152
+
153
+ macro_rules! impl_try_from_basic_type_enum {
154
+ ( $type_name: ident) => (
155
+ impl TryFrom <BasicTypeEnum > for $type_name {
156
+ type Error = & ' static str ;
157
+
158
+ fn try_from( ty: BasicTypeEnum ) -> Result <Self , Self :: Error > {
159
+ match ty {
160
+ BasicTypeEnum :: $type_name( ty) => Ok ( ty) ,
161
+ _ => Err ( "bad try from" ) ,
162
+ }
163
+ }
164
+ }
165
+ )
166
+ }
167
+
168
+ impl_try_from_basic_type_enum ! ( ArrayType ) ;
169
+ impl_try_from_basic_type_enum ! ( FloatType ) ;
170
+ impl_try_from_basic_type_enum ! ( IntType ) ;
171
+ impl_try_from_basic_type_enum ! ( PointerType ) ;
172
+ impl_try_from_basic_type_enum ! ( StructType ) ;
173
+ impl_try_from_basic_type_enum ! ( VectorType ) ;
Original file line number Diff line number Diff line change @@ -147,25 +147,3 @@ impl_try_from_basic_value_enum!(FloatValue);
147
147
impl_try_from_basic_value_enum ! ( PointerValue ) ;
148
148
impl_try_from_basic_value_enum ! ( StructValue ) ;
149
149
impl_try_from_basic_value_enum ! ( VectorValue ) ;
150
-
151
- macro_rules! impl_try_from_basic_type_enum {
152
- ( $type_name: ident) => (
153
- impl TryFrom <BasicTypeEnum > for $type_name {
154
- type Error = & ' static str ;
155
-
156
- fn try_from( ty: BasicTypeEnum ) -> Result <Self , Self :: Error > {
157
- match ty {
158
- BasicTypeEnum :: $type_name( ty) => Ok ( ty) ,
159
- _ => Err ( "bad try from" ) ,
160
- }
161
- }
162
- }
163
- )
164
- }
165
-
166
- impl_try_from_basic_type_enum ! ( ArrayType ) ;
167
- impl_try_from_basic_type_enum ! ( FloatType ) ;
168
- impl_try_from_basic_type_enum ! ( IntType ) ;
169
- impl_try_from_basic_type_enum ! ( PointerType ) ;
170
- impl_try_from_basic_type_enum ! ( StructType ) ;
171
- impl_try_from_basic_type_enum ! ( VectorType ) ;
You can’t perform that action at this time.
0 commit comments