Skip to content

Commit e57e782

Browse files
committed
---
yaml --- r: 4932 b: refs/heads/master c: 8bd019b h: refs/heads/master v: v3
1 parent e108129 commit e57e782

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
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: 608f7ccded67fd65d5e12ef2c0601170fb3345ed
2+
refs/heads/master: 8bd019bdc868e9d563aa72acbb0307deaeca919f

trunk/src/comp/middle/trans.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,10 +958,13 @@ fn get_derived_tydesc(cx: &@block_ctxt, t: ty::t, escapes: bool,
958958

959959
// If the tydesc escapes in this context, the cached derived
960960
// tydesc also has to be one that was marked as escaping.
961-
if !(escapes && !info.escapes) { ret rslt(cx, info.lltydesc); }
961+
if !(escapes && !info.escapes) && storage == tps_normal {
962+
ret rslt(cx, info.lltydesc);
963+
}
962964
}
963965
none. {/* fall through */ }
964966
}
967+
965968
bcx_ccx(cx).stats.n_derived_tydescs += 1u;
966969
let bcx = new_raw_block_ctxt(cx.fcx, cx.fcx.llderivedtydescs);
967970
let tys = linearize_ty_params(bcx, t);

trunk/src/rt/rust_crate_cache.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
#include "rust_internal.h"
3+
#include <algorithm>
34

45
type_desc *
56
rust_crate_cache::get_type_desc(size_t size,
@@ -14,6 +15,10 @@ rust_crate_cache::get_type_desc(size_t size,
1415
HASH_FIND(hh, this->type_descs, descs, keysz, td);
1516
if (td) {
1617
DLOG(sched, cache, "rust_crate_cache::get_type_desc hit");
18+
19+
// FIXME: This is a gross hack.
20+
td->n_obj_params = std::max(td->n_obj_params, n_obj_params);
21+
1722
return td;
1823
}
1924
DLOG(sched, cache, "rust_crate_cache::get_type_desc miss");

trunk/src/rt/rust_shape.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ class type_param {
259259
// Creates type parameters from a type descriptor.
260260
static inline type_param *from_tydesc(const type_desc *tydesc,
261261
arena &arena) {
262+
if (tydesc->n_obj_params) {
263+
// TODO
264+
}
262265
return make(tydesc->first_param, tydesc->n_params, arena);
263266
}
264267
};

0 commit comments

Comments
 (0)