@@ -133,7 +133,6 @@ impl to_bytes::IterBytes for creader_cache_key {
133
133
134
134
struct intern_key {
135
135
sty : * sty ,
136
- o_def_id : Option < ast:: def_id >
137
136
}
138
137
139
138
// NB: Do not replace this with #[deriving(Eq)]. The automatically-derived
@@ -142,7 +141,7 @@ struct intern_key {
142
141
impl cmp:: Eq for intern_key {
143
142
fn eq ( & self , other : & intern_key ) -> bool {
144
143
unsafe {
145
- * self . sty == * other. sty && self . o_def_id == other . o_def_id
144
+ * self . sty == * other. sty
146
145
}
147
146
}
148
147
fn ne ( & self , other : & intern_key ) -> bool {
@@ -153,7 +152,7 @@ impl cmp::Eq for intern_key {
153
152
impl to_bytes:: IterBytes for intern_key {
154
153
fn iter_bytes ( & self , +lsb0 : bool , f : to_bytes:: Cb ) {
155
154
unsafe {
156
- to_bytes :: iter_bytes_2 ( & * self . sty , & self . o_def_id , lsb0, f) ;
155
+ ( * self . sty ) . iter_bytes ( lsb0, f) ;
157
156
}
158
157
}
159
158
}
@@ -326,7 +325,6 @@ pub struct t_box_ {
326
325
sty : sty ,
327
326
id : uint ,
328
327
flags : uint ,
329
- o_def_id : Option < ast:: def_id >
330
328
}
331
329
332
330
// To reduce refcounting cost, we're representing types as unsafe pointers
@@ -359,7 +357,6 @@ pub fn type_needs_infer(t: t) -> bool {
359
357
pub fn type_has_regions ( t : t ) -> bool {
360
358
tbox_has_flag ( get ( t) , has_regions)
361
359
}
362
- pub fn type_def_id ( t : t ) -> Option < ast:: def_id > { get ( t) . o_def_id }
363
360
pub fn type_id ( t : t ) -> uint { get ( t) . id }
364
361
365
362
#[ deriving( Eq ) ]
@@ -516,7 +513,6 @@ pub struct substs {
516
513
mod primitives {
517
514
use super :: { sty, t_box_} ;
518
515
519
- use core:: option:: None ;
520
516
use syntax:: ast;
521
517
522
518
macro_rules! def_prim_ty(
@@ -525,7 +521,6 @@ mod primitives {
525
521
sty: $sty,
526
522
id: $id,
527
523
flags: 0 ,
528
- o_def_id: None ,
529
524
} ;
530
525
)
531
526
)
@@ -551,14 +546,12 @@ mod primitives {
551
546
sty : super :: ty_bot,
552
547
id : 16 ,
553
548
flags : super :: has_ty_bot as uint ,
554
- o_def_id : None ,
555
549
} ;
556
550
557
551
pub static TY_ERR : t_box_ = t_box_ {
558
552
sty : super :: ty_err,
559
553
id : 17 ,
560
554
flags : super :: has_ty_err as uint ,
561
- o_def_id : None ,
562
555
} ;
563
556
564
557
pub static LAST_PRIMITIVE_ID : uint = 18 ;
@@ -945,13 +938,11 @@ pub fn mk_ctxt(s: session::Session,
945
938
}
946
939
}
947
940
948
-
949
941
// Type constructors
950
- fn mk_t ( cx : ctxt , +st : sty ) -> t { mk_t_with_id ( cx, st, None ) }
951
942
952
943
// Interns a type/name combination, stores the resulting box in cx.interner,
953
944
// and returns the box as cast to an unsafe ptr (see comments for t above).
954
- fn mk_t_with_id ( cx : ctxt , +st : sty , o_def_id : Option < ast :: def_id > ) -> t {
945
+ fn mk_t ( cx : ctxt , +st : sty ) -> t {
955
946
// Check for primitive types.
956
947
match st {
957
948
ty_nil => return mk_nil ( cx) ,
@@ -963,7 +954,7 @@ fn mk_t_with_id(cx: ctxt, +st: sty, o_def_id: Option<ast::def_id>) -> t {
963
954
_ => { }
964
955
} ;
965
956
966
- let key = intern_key { sty : to_unsafe_ptr ( & st) , o_def_id : o_def_id } ;
957
+ let key = intern_key { sty : to_unsafe_ptr ( & st) } ;
967
958
match cx. interner . find ( & key) {
968
959
Some ( t) => unsafe { return cast:: transmute ( & t. sty ) ; } ,
969
960
_ => ( )
@@ -1039,14 +1030,12 @@ fn mk_t_with_id(cx: ctxt, +st: sty, o_def_id: Option<ast::def_id>) -> t {
1039
1030
sty : st,
1040
1031
id : * cx. next_id ,
1041
1032
flags : flags,
1042
- o_def_id : o_def_id
1043
1033
} ;
1044
1034
1045
1035
let sty_ptr = to_unsafe_ptr ( & t. sty ) ;
1046
1036
1047
1037
let key = intern_key {
1048
1038
sty : sty_ptr,
1049
- o_def_id : o_def_id
1050
1039
} ;
1051
1040
1052
1041
cx. interner . insert ( key, t) ;
@@ -1263,10 +1252,6 @@ pub fn mk_opaque_closure_ptr(cx: ctxt, sigil: ast::Sigil) -> t {
1263
1252
1264
1253
pub fn mk_opaque_box ( cx : ctxt ) -> t { mk_t ( cx, ty_opaque_box) }
1265
1254
1266
- pub fn mk_with_id ( cx : ctxt , base : t , def_id : ast:: def_id ) -> t {
1267
- mk_t_with_id ( cx, /*bad*/ copy get( base) . sty , Some ( def_id) )
1268
- }
1269
-
1270
1255
// Converts s to its machine type equivalent
1271
1256
pub fn mach_sty ( cfg : @session:: config , t : t ) -> sty {
1272
1257
match get ( t) . sty {
0 commit comments