@@ -105,9 +105,11 @@ tag sty {
105
105
ty_machine ( util:: common:: ty_mach) ;
106
106
ty_char;
107
107
ty_str;
108
+ ty_istr;
108
109
ty_tag ( ast:: def_id, vec[ t] ) ;
109
110
ty_box ( mt) ;
110
111
ty_vec ( mt) ;
112
+ ty_ivec ( mt) ;
111
113
ty_ptr ( mt) ;
112
114
ty_port ( t) ;
113
115
ty_chan ( t) ;
@@ -162,11 +164,12 @@ const uint idx_f32 = 13u;
162
164
const uint idx_f64 = 14 u;
163
165
const uint idx_char = 15 u;
164
166
const uint idx_str = 16 u;
165
- const uint idx_task = 17 u;
166
- const uint idx_native = 18 u;
167
- const uint idx_type = 19 u;
168
- const uint idx_bot = 20 u;
169
- const uint idx_first_others = 21 u;
167
+ const uint idx_istr = 17 u;
168
+ const uint idx_task = 18 u;
169
+ const uint idx_native = 19 u;
170
+ const uint idx_type = 20 u;
171
+ const uint idx_bot = 21 u;
172
+ const uint idx_first_others = 22 u;
170
173
171
174
type type_store = interner:: interner [ raw_t] ;
172
175
@@ -193,6 +196,7 @@ fn populate_type_store(&ctxt cx) {
193
196
intern ( cx, ty_machine ( ty_f64) , none[ str] ) ;
194
197
intern ( cx, ty_char, none[ str] ) ;
195
198
intern ( cx, ty_str, none[ str] ) ;
199
+ intern ( cx, ty_istr, none[ str] ) ;
196
200
intern ( cx, ty_task, none[ str] ) ;
197
201
intern ( cx, ty_native, none[ str] ) ;
198
202
intern ( cx, ty_type, none[ str] ) ;
@@ -388,6 +392,7 @@ fn mk_mach(&ctxt cx, &util::common::ty_mach tm) -> t {
388
392
389
393
fn mk_char ( & ctxt cx) -> t { ret idx_char; }
390
394
fn mk_str ( & ctxt cx) -> t { ret idx_str; }
395
+ fn mk_istr ( & ctxt cx) -> t { ret idx_istr; }
391
396
392
397
fn mk_tag ( & ctxt cx, & ast:: def_id did, & vec[ t] tys ) -> t {
393
398
ret gen_ty ( cx, ty_tag ( did, tys) ) ;
@@ -407,6 +412,8 @@ fn mk_imm_box(&ctxt cx, &t ty) -> t {
407
412
408
413
fn mk_vec ( & ctxt cx, & mt tm) -> t { ret gen_ty ( cx, ty_vec ( tm) ) ; }
409
414
415
+ fn mk_ivec ( & ctxt cx, & mt tm) -> t { ret gen_ty ( cx, ty_ivec ( tm) ) ; }
416
+
410
417
fn mk_imm_vec ( & ctxt cx, & t typ ) -> t {
411
418
ret gen_ty ( cx, ty_vec ( rec ( ty=typ, mut=ast:: imm) ) ) ;
412
419
}
@@ -494,10 +501,12 @@ fn walk_ty(&ctxt cx, ty_walk walker, t ty) {
494
501
case ( ty_machine ( _) ) { /* no-op */ }
495
502
case ( ty_char) { /* no-op */ }
496
503
case ( ty_str) { /* no-op */ }
504
+ case ( ty_istr) { /* no-op */ }
497
505
case ( ty_type) { /* no-op */ }
498
506
case ( ty_native) { /* no-op */ }
499
507
case ( ty_box ( ?tm) ) { walk_ty ( cx, walker, tm. ty ) ; }
500
508
case ( ty_vec ( ?tm) ) { walk_ty ( cx, walker, tm. ty ) ; }
509
+ case ( ty_ivec ( ?tm) ) { walk_ty ( cx, walker, tm. ty ) ; }
501
510
case ( ty_port ( ?subty) ) { walk_ty ( cx, walker, subty) ; }
502
511
case ( ty_chan ( ?subty) ) { walk_ty ( cx, walker, subty) ; }
503
512
case ( ty_tag ( ?tid, ?subtys) ) {
@@ -998,48 +1007,50 @@ fn hash_type_structure(&sty st) -> uint {
998
1007
}
999
1008
case ( ty_char) { ret 15 u; }
1000
1009
case ( ty_str) { ret 16 u; }
1010
+ case ( ty_istr) { ret 17 u; }
1001
1011
case ( ty_tag( ?did, ?tys) ) {
1002
- auto h = hash_def( 17 u , did) ;
1012
+ auto h = hash_def( 18 u , did) ;
1003
1013
for ( t typ in tys) {
1004
1014
h += h << 5 u + hash_ty( typ) ;
1005
1015
}
1006
1016
ret h;
1007
1017
}
1008
- case ( ty_box( ?mt) ) { ret hash_subty( 18 u, mt. ty) ; }
1009
- case ( ty_vec( ?mt) ) { ret hash_subty( 19 u, mt. ty) ; }
1010
- case ( ty_port( ?typ) ) { ret hash_subty( 20 u, typ) ; }
1011
- case ( ty_chan( ?typ) ) { ret hash_subty( 21 u, typ) ; }
1012
- case ( ty_task) { ret 22 u; }
1018
+ case ( ty_box( ?mt) ) { ret hash_subty( 19 u, mt. ty) ; }
1019
+ case ( ty_vec( ?mt) ) { ret hash_subty( 20 u, mt. ty) ; }
1020
+ case ( ty_ivec( ?mt) ) { ret hash_subty( 21 u, mt. ty) ; }
1021
+ case ( ty_port( ?typ) ) { ret hash_subty( 22 u, typ) ; }
1022
+ case ( ty_chan( ?typ) ) { ret hash_subty( 23 u, typ) ; }
1023
+ case ( ty_task) { ret 24 u; }
1013
1024
case ( ty_tup( ?mts) ) {
1014
- auto h = 23 u ;
1025
+ auto h = 25 u ;
1015
1026
for ( mt tm in mts) {
1016
1027
h += h << 5 u + hash_ty( tm. ty) ;
1017
1028
}
1018
1029
ret h;
1019
1030
}
1020
1031
case ( ty_rec( ?fields) ) {
1021
- auto h = 24 u ;
1032
+ auto h = 26 u ;
1022
1033
for ( field f in fields) {
1023
1034
h += h << 5 u + hash_ty( f. mt. ty) ;
1024
1035
}
1025
1036
ret h;
1026
1037
}
1027
1038
// ???
1028
- case ( ty_fn( _, ?args, ?rty, _, _) ) { ret hash_fn( 25 u , args, rty) ; }
1029
- case ( ty_native_fn( _, ?args, ?rty) ) { ret hash_fn( 26 u , args, rty) ; }
1039
+ case ( ty_fn( _, ?args, ?rty, _, _) ) { ret hash_fn( 27 u , args, rty) ; }
1040
+ case ( ty_native_fn( _, ?args, ?rty) ) { ret hash_fn( 28 u , args, rty) ; }
1030
1041
case ( ty_obj( ?methods) ) {
1031
- auto h = 27 u ;
1042
+ auto h = 29 u ;
1032
1043
for ( method m in methods) {
1033
1044
h += h << 5 u + str :: hash( m. ident) ;
1034
1045
}
1035
1046
ret h;
1036
1047
}
1037
- case ( ty_var( ?v) ) { ret hash_uint( 28 u , v as uint) ; }
1038
- case ( ty_param( ?pid) ) { ret hash_uint( 29 u , pid) ; }
1039
- case ( ty_type) { ret 30 u ; }
1040
- case ( ty_native) { ret 31 u ; }
1041
- case ( ty_bot) { ret 32 u ; }
1042
- case ( ty_ptr( ?mt) ) { ret hash_subty( 33 u , mt. ty) ; }
1048
+ case ( ty_var( ?v) ) { ret hash_uint( 30 u , v as uint) ; }
1049
+ case ( ty_param( ?pid) ) { ret hash_uint( 31 u , pid) ; }
1050
+ case ( ty_type) { ret 32 u ; }
1051
+ case ( ty_native) { ret 33 u ; }
1052
+ case ( ty_bot) { ret 34 u ; }
1053
+ case ( ty_ptr( ?mt) ) { ret hash_subty( 35 u , mt. ty) ; }
1043
1054
}
1044
1055
}
1045
1056
0 commit comments