Skip to content

Commit d844cee

Browse files
committed
---
yaml --- r: 118253 b: refs/heads/try c: 14d626a h: refs/heads/master i: 118251: 366d846 v: v3
1 parent 4ff4482 commit d844cee

File tree

2 files changed

+6
-33
lines changed

2 files changed

+6
-33
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3770c42a4959cbabc73da52abc7e3db96657974e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: d6736a1440d42f6af967a8a20ab8d73522112b72
5-
refs/heads/try: f24a53757e1e78fcf7f3a9208a0496dee26a6423
5+
refs/heads/try: 14d626a9fa645186b87717cab6bfb976d5c13ab0
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/middle/trans/monomorphize.rs

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,7 @@ pub fn monomorphic_fn(ccx: &CrateContext,
5555
let _icx = push_ctxt("monomorphic_fn");
5656

5757
let substs_iter = real_substs.self_ty.iter().chain(real_substs.tps.iter());
58-
let param_ids: Vec<MonoParamId> = match vtables {
59-
Some(ref vts) => {
60-
debug!("make_mono_id vtables={} psubsts={}",
61-
vts.repr(ccx.tcx()), real_substs.tps.repr(ccx.tcx()));
62-
let vts_iter = self_vtables.iter().chain(vts.iter());
63-
vts_iter.zip(substs_iter).map(|(vtable, subst)| MonoParamId {
64-
subst: *subst,
65-
// Do we really need the vtables to be hashed? Isn't the type enough?
66-
vtables: vtable.iter().map(|vt| make_vtable_id(ccx, vt)).collect()
67-
}).collect()
68-
}
69-
None => substs_iter.map(|subst| MonoParamId {
70-
subst: *subst,
71-
vtables: Vec::new()
72-
}).collect()
73-
};
74-
58+
let param_ids: Vec<ty::t> = substs_iter.map(|t| *t).collect();
7559
let hash_id = MonoId {
7660
def: fn_id,
7761
params: param_ids
@@ -317,33 +301,22 @@ pub fn monomorphic_fn(ccx: &CrateContext,
317301
#[deriving(PartialEq, Eq, Hash)]
318302
pub struct MonoParamId {
319303
pub subst: ty::t,
320-
// Do we really need the vtables to be hashed? Isn't the type enough?
321-
pub vtables: Vec<MonoId>
322304
}
323305

324306
#[deriving(PartialEq, Eq, Hash)]
325307
pub struct MonoId {
326308
pub def: ast::DefId,
327-
pub params: Vec<MonoParamId>
309+
pub params: Vec<ty::t>
328310
}
329311

330-
pub fn make_vtable_id(ccx: &CrateContext,
312+
pub fn make_vtable_id(_ccx: &CrateContext,
331313
origin: &typeck::vtable_origin)
332314
-> MonoId {
333315
match origin {
334-
&typeck::vtable_static(impl_id, ref substs, ref sub_vtables) => {
316+
&typeck::vtable_static(impl_id, ref substs, _) => {
335317
MonoId {
336318
def: impl_id,
337-
// FIXME(NDM) -- this is pretty bogus. It ignores self-type,
338-
// and vtables are not necessary, AND they are not guaranteed
339-
// to be same length as the number of TPS ANYHOW!
340-
params: sub_vtables.iter().zip(substs.tps.iter()).map(|(vtable, subst)| {
341-
MonoParamId {
342-
subst: *subst,
343-
// Do we really need the vtables to be hashed? Isn't the type enough?
344-
vtables: vtable.iter().map(|vt| make_vtable_id(ccx, vt)).collect()
345-
}
346-
}).collect()
319+
params: substs.tps.iter().map(|subst| *subst).collect()
347320
}
348321
}
349322

0 commit comments

Comments
 (0)