From 675f762621a0e2bb7d746e82bcafa05650786b94 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Wed, 2 Mar 2011 18:23:38 -0800 Subject: rustc: Have make_generic_glue pass an opaque type instead of an incorrect type in the case of dynamically sized types --- src/comp/middle/trans.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/comp') diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 4708ffc5..3d4f44ea 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -1267,7 +1267,9 @@ fn make_generic_glue(@crate_ctxt cx, @ty.t t, str name, auto re; if (!ty.type_is_scalar(t)) { auto llty; - if (ty.type_is_structural(t)) { + if (ty.type_has_dynamic_size(t)) { + llty = T_ptr(T_i8()); + } else if (ty.type_is_structural(t)) { llty = T_ptr(type_of(cx, t)); } else { llty = type_of(cx, t); -- cgit v1.2.3