Skip to content

Commit 649c79c

Browse files
committed
---
yaml --- r: 2477 b: refs/heads/master c: 6953841 h: refs/heads/master i: 2475: b06b264 v: v3
1 parent 0cbda35 commit 649c79c

File tree

2 files changed

+4
-41
lines changed

2 files changed

+4
-41
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: df914e89041bd6a133c6fb642144668bafae5a80
2+
refs/heads/master: 6953841e25ab7f52b77fc6a37d01cb071ace21b0

trunk/src/comp/middle/ty.rs

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ fn method_ty_to_fn_ty(ctxt cx, method m) -> t {
7373
// outside world, to enforce the above invariants.
7474
type raw_t = rec(sty struct,
7575
Option.t[str] cname,
76-
uint magic,
7776
uint hash,
7877
bool has_params,
7978
bool has_bound_params,
@@ -236,7 +235,6 @@ fn mk_ctxt(session.session s) -> ctxt {
236235

237236
fn mk_ty_full(&sty st, &Option.t[str] cname) -> t {
238237
auto h = hash_type_info(st, cname);
239-
auto magic = mk_magic(st);
240238

241239
let bool has_params = false;
242240
let bool has_bound_params = false;
@@ -352,7 +350,7 @@ fn mk_ty_full(&sty st, &Option.t[str] cname) -> t {
352350
case (_) { }
353351
}
354352

355-
ret @rec(struct=st, cname=cname, magic=magic, hash=h,
353+
ret @rec(struct=st, cname=cname, hash=h,
356354
has_params = has_params,
357355
has_bound_params = has_bound_params,
358356
has_vars = has_vars,
@@ -1048,40 +1046,6 @@ fn def_to_str(&ast.def_id did) -> str {
10481046
}
10491047

10501048

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 1u; }
1057-
case (ty_bool) { ret 2u; }
1058-
case (ty_int) { ret 3u; }
1059-
case (ty_float) { ret 4u; }
1060-
case (ty_uint) { ret 5u; }
1061-
case (ty_char) { ret 6u; }
1062-
case (ty_str) { ret 7u; }
1063-
case (ty_task) { ret 8u; }
1064-
case (ty_type) { ret 9u; }
1065-
case (ty_native) { ret 10u; }
1066-
case (ty_machine(?tm)) {
1067-
alt (tm) {
1068-
case (common.ty_i8) { ret 11u; }
1069-
case (common.ty_i16) { ret 12u; }
1070-
case (common.ty_i32) { ret 13u; }
1071-
case (common.ty_i64) { ret 14u; }
1072-
case (common.ty_u8) { ret 15u; }
1073-
case (common.ty_u16) { ret 16u; }
1074-
case (common.ty_u32) { ret 17u; }
1075-
case (common.ty_u64) { ret 18u; }
1076-
case (common.ty_f32) { ret 19u; }
1077-
case (common.ty_f64) { ret 20u; }
1078-
}
1079-
}
1080-
case (_) { ret 0u; }
1081-
}
1082-
}
1083-
1084-
10851049
// Type hashing. This function is private to this module (and slow); external
10861050
// users should use `hash_ty()` instead.
10871051
fn hash_type_structure(&sty st) -> uint {
@@ -1503,10 +1467,9 @@ fn equal_type_structures(&sty a, &sty b) -> bool {
15031467

15041468
// An expensive type equality function. This function is private to this
15051469
// module.
1470+
//
1471+
// FIXME: Use structural comparison, but this loops forever and segfaults.
15061472
fn eq_ty_full(&t a, &t b) -> bool {
1507-
// Check magic numbers (fast path).
1508-
if (a.magic != 0u || b.magic != 0u) { ret a.magic == b.magic; }
1509-
15101473
// Check hashes (fast path).
15111474
if (a.hash != b.hash) {
15121475
ret false;

0 commit comments

Comments
 (0)