@@ -33,13 +33,13 @@ pub fn intrinsic_handler(ctx: &mut Ctx, hir: &mut hir::Hir, hir_node: HirId) {
3333 . parameters
3434 . iter ( )
3535 . zip ( hir_signature. parameters . iter ( ) . map ( |( _, ty) | * ty) )
36- . all ( |( intrinsic, signature) | intrinsic. into_type ( & mut ctx. types ) == signature)
36+ . all ( |( intrinsic, signature) | intrinsic. as_type ( & mut ctx. types ) == signature)
3737 // Return type must match.
3838 && intrinsic
3939 . signature
4040 . return_ty
4141 . as_ref ( )
42- . map ( |ty| ty. into_type ( & mut ctx. types ) )
42+ . map ( |ty| ty. as_type ( & mut ctx. types ) )
4343 . unwrap_or ( ctx. types . unit ( ) )
4444 == hir_signature. return_ty ;
4545 if !signature_valid {
@@ -113,15 +113,15 @@ enum PrimitiveType {
113113}
114114
115115impl PrimitiveType {
116- fn into_type ( & self , types : & mut Types ) -> TypeId {
116+ fn as_type ( & self , types : & mut Types ) -> TypeId {
117117 match self {
118118 PrimitiveType :: U8 => types. u8 ( ) ,
119119 PrimitiveType :: I8 => types. i8 ( ) ,
120120 PrimitiveType :: Boolean => types. boolean ( ) ,
121121 PrimitiveType :: Tuple ( primitive_types) => {
122122 let inner = primitive_types
123123 . iter ( )
124- . map ( |ty| ty. into_type ( types) )
124+ . map ( |ty| ty. as_type ( types) )
125125 . collect :: < Vec < _ > > ( ) ;
126126 types. tuple ( inner)
127127 }
@@ -214,4 +214,8 @@ intrinsics! {
214214 u8_add_wrapping( lhs: u8 , rhs: u8 ) -> u8 { BinaryOperation ( Plus ) } ;
215215 u8_add_overflow( lhs: u8 , rhs: u8 ) -> ( u8 , bool ) { BinaryOperation ( PlusWithOverflow ) } ;
216216 u8_not( n: u8 ) -> u8 { UnaryOperation ( Not ) } ;
217+
218+ i8_add_wrapping( lhs: i8 , rhs: i8 ) -> i8 { BinaryOperation ( Plus ) } ;
219+ i8_add_overflow( lhs: i8 , rhs: i8 ) -> ( i8 , bool ) { BinaryOperation ( PlusWithOverflow ) } ;
220+ i8_not( n: i8 ) -> i8 { UnaryOperation ( Not ) } ;
217221}
0 commit comments