From 0c4e0fdfae2fad4a132bdfef3cb856ec5dde84c9 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 23 Sep 2011 16:51:50 -0700 Subject: rt: Get rid of the hack that looks for captured type descriptors adjacent to the root one for functions and objects --- src/rt/rust_shape.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/rt/rust_shape.cpp') diff --git a/src/rt/rust_shape.cpp b/src/rt/rust_shape.cpp index d25c340264e..994c4df0fb9 100644 --- a/src/rt/rust_shape.cpp +++ b/src/rt/rust_shape.cpp @@ -37,7 +37,10 @@ type_param::make(const type_desc **tydescs, unsigned n_tydescs, const type_desc *subtydesc = tydescs[i]; ptrs[i].shape = subtydesc->shape; ptrs[i].tables = subtydesc->shape_tables; - ptrs[i].params = from_tydesc(&subtydesc, arena); + + // FIXME: Doesn't handle a type-parametric object closing over a + // type-parametric object type properly. + ptrs[i].params = from_tydesc(subtydesc, arena); } return ptrs; } @@ -531,8 +534,12 @@ upcall_cmp_type(int8_t *result, rust_task *task, const type_desc *tydesc, const type_desc **subtydescs, uint8_t *data_0, uint8_t *data_1, uint8_t cmp_type) { shape::arena arena; + + // FIXME: This may well be broken when comparing two closures or objects + // that close over different sets of type parameters. shape::type_param *params = - shape::type_param::from_tydesc(&tydesc, arena); + shape::type_param::from_tydesc_and_data(tydesc, data_0, arena); + shape::cmp cmp(task, true, tydesc->shape, params, tydesc->shape_tables, data_0, data_1); cmp.walk(); @@ -552,7 +559,7 @@ upcall_log_type(rust_task *task, const type_desc *tydesc, uint8_t *data, shape::arena arena; shape::type_param *params = - shape::type_param::from_tydesc(&tydesc, arena); + shape::type_param::from_tydesc_and_data(tydesc, data, arena); std::stringstream ss; shape::log log(task, true, tydesc->shape, params, tydesc->shape_tables, -- cgit 1.4.1-3-g733a5