@@ -73,7 +73,6 @@ fn method_ty_to_fn_ty(ctxt cx, method m) -> t {
73
73
// outside world, to enforce the above invariants.
74
74
type raw_t = rec ( sty struct ,
75
75
Option . t[ str] cname ,
76
- uint magic ,
77
76
uint hash,
78
77
bool has_params ,
79
78
bool has_bound_params ,
@@ -236,7 +235,6 @@ fn mk_ctxt(session.session s) -> ctxt {
236
235
237
236
fn mk_ty_full ( & sty st, & Option . t[ str] cname ) -> t {
238
237
auto h = hash_type_info ( st, cname) ;
239
- auto magic = mk_magic ( st) ;
240
238
241
239
let bool has_params = false ;
242
240
let bool has_bound_params = false ;
@@ -352,7 +350,7 @@ fn mk_ty_full(&sty st, &Option.t[str] cname) -> t {
352
350
case ( _) { }
353
351
}
354
352
355
- ret @rec( struct=st, cname=cname, magic=magic , hash=h,
353
+ ret @rec( struct=st, cname=cname, hash=h,
356
354
has_params = has_params,
357
355
has_bound_params = has_bound_params,
358
356
has_vars = has_vars,
@@ -1048,40 +1046,6 @@ fn def_to_str(&ast.def_id did) -> str {
1048
1046
}
1049
1047
1050
1048
1051
- // Generation of "magic numbers", which are workarounds for the lack of
1052
- // structural equality in rustboot.
1053
-
1054
- fn mk_magic( & sty st) -> uint {
1055
- alt ( st) {
1056
- case ( ty_nil) { ret 1 u; }
1057
- case ( ty_bool) { ret 2 u; }
1058
- case ( ty_int) { ret 3 u; }
1059
- case ( ty_float) { ret 4 u; }
1060
- case ( ty_uint) { ret 5 u; }
1061
- case ( ty_char) { ret 6 u; }
1062
- case ( ty_str) { ret 7 u; }
1063
- case ( ty_task) { ret 8 u; }
1064
- case ( ty_type) { ret 9 u; }
1065
- case ( ty_native) { ret 10 u; }
1066
- case ( ty_machine( ?tm) ) {
1067
- alt ( tm) {
1068
- case ( common. ty_i8) { ret 11 u; }
1069
- case ( common. ty_i16) { ret 12 u; }
1070
- case ( common. ty_i32) { ret 13 u; }
1071
- case ( common. ty_i64) { ret 14 u; }
1072
- case ( common. ty_u8) { ret 15 u; }
1073
- case ( common. ty_u16) { ret 16 u; }
1074
- case ( common. ty_u32) { ret 17 u; }
1075
- case ( common. ty_u64) { ret 18 u; }
1076
- case ( common. ty_f32) { ret 19 u; }
1077
- case ( common. ty_f64) { ret 20 u; }
1078
- }
1079
- }
1080
- case ( _) { ret 0 u; }
1081
- }
1082
- }
1083
-
1084
-
1085
1049
// Type hashing. This function is private to this module (and slow); external
1086
1050
// users should use `hash_ty()` instead.
1087
1051
fn hash_type_structure( & sty st) -> uint {
@@ -1503,10 +1467,9 @@ fn equal_type_structures(&sty a, &sty b) -> bool {
1503
1467
1504
1468
// An expensive type equality function. This function is private to this
1505
1469
// module.
1470
+ //
1471
+ // FIXME: Use structural comparison, but this loops forever and segfaults.
1506
1472
fn eq_ty_full ( & t a, & t b) -> bool {
1507
- // Check magic numbers (fast path).
1508
- if ( a. magic != 0 u || b. magic != 0 u) { ret a. magic == b. magic ; }
1509
-
1510
1473
// Check hashes (fast path).
1511
1474
if ( a. hash != b. hash ) {
1512
1475
ret false ;
0 commit comments