@@ -68,7 +68,6 @@ export mk_vec;
68
68
export mk_mach_int;
69
69
export mk_mach_uint;
70
70
export mk_mach_float;
71
- export mk_native;
72
71
export mk_nil;
73
72
export mk_iface;
74
73
export mk_res;
@@ -116,7 +115,6 @@ export ty_fn_ret_style;
116
115
export ty_int;
117
116
export ty_str;
118
117
export ty_vec;
119
- export ty_native;
120
118
export ty_nil;
121
119
export ty_iface;
122
120
export ty_res;
@@ -153,7 +151,6 @@ export type_is_fp;
153
151
export type_allows_implicit_copy;
154
152
export type_is_integral;
155
153
export type_is_numeric;
156
- export type_is_native;
157
154
export type_is_nil;
158
155
export type_is_pod;
159
156
export type_is_scalar;
@@ -270,7 +267,6 @@ enum sty {
270
267
271
268
ty_type, // type_desc*
272
269
ty_send_type, // type_desc* that has been cloned into exchange heap
273
- ty_native( def_id ) ,
274
270
ty_constr( t , [ @type_constr ] ) ,
275
271
ty_opaque_closure_ptr( closure_kind ) , // ptr to env for fn, fn@, fn~
276
272
ty_named( t , @str ) ,
@@ -458,10 +454,7 @@ fn mk_raw_ty(cx: ctxt, st: sty) -> @raw_t {
458
454
}
459
455
alt st {
460
456
ty_nil | ty_bot | ty_bool | ty_int ( _) | ty_float ( _) | ty_uint ( _) |
461
- ty_str | ty_type | ty_send_type | ty_native ( _) |
462
- ty_opaque_closure_ptr ( _) {
463
- /* no-op */
464
- }
457
+ ty_str | ty_type | ty_send_type | ty_opaque_closure_ptr ( _) { }
465
458
ty_param ( _, _) { has_params = true ; }
466
459
ty_var ( _) { has_vars = true ; }
467
460
ty_enum ( _, tys) | ty_iface ( _, tys) {
@@ -607,8 +600,6 @@ fn mk_type(_cx: ctxt) -> t { ret idx_type; }
607
600
608
601
fn mk_send_type ( _cx : ctxt ) -> t { ret idx_send_type; }
609
602
610
- fn mk_native ( cx : ctxt , did : def_id ) -> t { ret gen_ty ( cx, ty_native ( did) ) ; }
611
-
612
603
fn mk_opaque_closure_ptr ( cx : ctxt , ck : closure_kind ) -> t {
613
604
ret gen_ty ( cx, ty_opaque_closure_ptr ( ck) ) ;
614
605
}
@@ -658,7 +649,7 @@ pure fn ty_name(cx: ctxt, typ: t) -> option<@str> {
658
649
fn walk_ty ( cx : ctxt , ty : t , f : fn ( t ) ) {
659
650
alt struct( cx, ty) {
660
651
ty_nil | ty_bot | ty_bool | ty_int ( _) | ty_uint ( _) | ty_float ( _) |
661
- ty_str | ty_send_type | ty_type | ty_native ( _ ) |
652
+ ty_str | ty_send_type | ty_type |
662
653
ty_opaque_closure_ptr ( _) | ty_var ( _) | ty_param ( _, _) { }
663
654
ty_box ( tm) | ty_vec ( tm) | ty_ptr ( tm) { walk_ty ( cx, tm. ty , f) ; }
664
655
ty_enum ( _, subtys) | ty_iface ( _, subtys) {
@@ -702,10 +693,7 @@ fn fold_ty(cx: ctxt, fld: fold_mode, ty_0: t) -> t {
702
693
}
703
694
alt interner:: get ( * cx. ts , ty) . struct {
704
695
ty_nil | ty_bot | ty_bool | ty_int ( _) | ty_uint ( _) | ty_float ( _) |
705
- ty_str | ty_type | ty_send_type | ty_native ( _) |
706
- ty_opaque_closure_ptr ( _) {
707
- /* no-op */
708
- }
696
+ ty_str | ty_type | ty_send_type | ty_opaque_closure_ptr ( _) { }
709
697
ty_box ( tm) {
710
698
ty = mk_box ( cx, { ty: fold_ty ( cx, fld, tm. ty ) , mut: tm. mut } ) ;
711
699
}
@@ -889,15 +877,15 @@ pure fn type_is_unique(cx: ctxt, ty: t) -> bool {
889
877
pure fn type_is_scalar ( cx : ctxt , ty : t ) -> bool {
890
878
alt struct( cx, ty) {
891
879
ty_nil | ty_bool | ty_int ( _) | ty_float ( _) | ty_uint ( _) |
892
- ty_send_type | ty_type | ty_native ( _ ) | ty_ptr ( _) { true }
880
+ ty_send_type | ty_type | ty_ptr ( _) { true }
893
881
_ { false }
894
882
}
895
883
}
896
884
897
885
// FIXME maybe inline this for speed?
898
886
fn type_is_immediate ( cx : ctxt , ty : t ) -> bool {
899
887
ret type_is_scalar ( cx, ty) || type_is_boxed ( cx, ty) ||
900
- type_is_unique ( cx, ty) || type_is_native ( cx , ty ) ;
888
+ type_is_unique ( cx, ty) ;
901
889
}
902
890
903
891
fn type_needs_drop ( cx : ctxt , ty : t ) -> bool {
@@ -910,7 +898,7 @@ fn type_needs_drop(cx: ctxt, ty: t) -> bool {
910
898
let result = alt struct ( cx, ty) {
911
899
// scalar types
912
900
ty_nil | ty_bot | ty_bool | ty_int ( _) | ty_float ( _) | ty_uint ( _) |
913
- ty_type | ty_native ( _ ) | ty_ptr ( _) { false }
901
+ ty_type | ty_ptr ( _) { false }
914
902
ty_rec ( flds) {
915
903
for f in flds { if type_needs_drop ( cx, f. mt . ty ) { accum = true ; } }
916
904
accum
@@ -993,8 +981,7 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
993
981
let result = alt struct ( cx, ty) {
994
982
// Scalar and unique types are sendable
995
983
ty_nil | ty_bot | ty_bool | ty_int ( _) | ty_uint ( _) | ty_float ( _) |
996
- ty_native ( _) | ty_ptr ( _) |
997
- ty_send_type | ty_str { kind_sendable }
984
+ ty_ptr ( _) | ty_send_type | ty_str { kind_sendable }
998
985
ty_type { kind_copyable }
999
986
ty_fn ( f) { proto_kind ( f. proto ) }
1000
987
ty_opaque_closure_ptr ( ck_block) { kind_noncopyable }
@@ -1043,12 +1030,6 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
1043
1030
ret result;
1044
1031
}
1045
1032
1046
- // FIXME: should we just return true for native types in
1047
- // type_is_scalar?
1048
- fn type_is_native ( cx : ctxt , ty : t ) -> bool {
1049
- alt struct( cx, ty) { ty_native ( _) { ret true ; } _ { ret false; } }
1050
- }
1051
-
1052
1033
fn type_structurally_contains ( cx : ctxt , ty : t , test : fn ( sty ) -> bool ) ->
1053
1034
bool {
1054
1035
let sty = struct ( cx, ty) ;
@@ -1168,7 +1149,7 @@ fn type_is_pod(cx: ctxt, ty: t) -> bool {
1168
1149
alt struct( cx, ty) {
1169
1150
// Scalar types
1170
1151
ty_nil | ty_bot | ty_bool | ty_int ( _) | ty_float ( _) | ty_uint ( _) |
1171
- ty_send_type | ty_type | ty_native ( _ ) | ty_ptr ( _) { result = true ; }
1152
+ ty_send_type | ty_type | ty_ptr ( _) { result = true ; }
1172
1153
// Boxed types
1173
1154
ty_str | ty_box ( _) | ty_uniq ( _) | ty_vec ( _) | ty_fn ( _) |
1174
1155
ty_iface ( _, _) { result = false ; }
@@ -1359,7 +1340,6 @@ fn hash_type_structure(st: sty) -> uint {
1359
1340
ty_var ( v) { ret hash_uint ( 30 u, v as uint ) ; }
1360
1341
ty_param ( pid, _) { ret hash_uint ( 31 u, pid) ; }
1361
1342
ty_type { ret 32 u; }
1362
- ty_native( did) { ret hash_def ( 33 u, did) ; }
1363
1343
ty_bot { ret 34 u; }
1364
1344
ty_ptr( mt) { ret hash_subty ( 35 u, mt. ty ) ; }
1365
1345
ty_res ( did, sub, tps) {
@@ -2082,16 +2062,6 @@ mod unify {
2082
2062
ty:: ty_str | ty:: ty_send_type {
2083
2063
ret struct_cmp( cx, expected, actual) ;
2084
2064
}
2085
- ty:: ty_native ( ex_id) {
2086
- alt struct( cx. tcx , actual) {
2087
- ty_native ( act_id) {
2088
- if ex_id. crate == act_id. crate && ex_id. node == act_id. node {
2089
- ret ures_ok ( actual) ;
2090
- } else { ret ures_err ( terr_mismatch) ; }
2091
- }
2092
- _ { ret ures_err( terr_mismatch) ; }
2093
- }
2094
- }
2095
2065
ty:: ty_param ( expected_n, _) {
2096
2066
alt struct( cx. tcx , actual) {
2097
2067
ty:: ty_param ( actual_n, _) if expected_n == actual_n {
@@ -2515,7 +2485,7 @@ fn def_has_ty_params(def: ast::def) -> bool {
2515
2485
ast : : def_mod ( _) | ast:: def_const ( _) |
2516
2486
ast:: def_arg ( _, _) | ast:: def_local ( _, _) | ast:: def_upvar ( _, _, _) |
2517
2487
ast:: def_ty_param ( _, _) | ast:: def_binding ( _) | ast:: def_use ( _) |
2518
- ast:: def_native_ty ( _ ) | ast :: def_self ( _) | ast:: def_ty ( _) { false }
2488
+ ast:: def_self ( _) | ast:: def_ty ( _) { false }
2519
2489
ast:: def_fn ( _, _) | ast:: def_variant ( _, _) { true }
2520
2490
_ { false } // ????
2521
2491
}
0 commit comments