Fix a leak when box types are used via type descriptors.

This commit is contained in:
Graydon Hoare 2010-09-12 01:05:56 -07:00
parent a493350eb5
commit 67aa39e1ef
3 changed files with 10 additions and 2 deletions

View File

@ -488,6 +488,7 @@ TEST_XFAILS_LLVM := $(TASK_XFAILS) \
lazy-and-or.rs \
lazy-init.rs \
lazychan.rs \
leak-box-as-tydesc.rs \
lib-deque.rs \
lib-int.rs \
lib-io.rs \

View File

@ -2562,8 +2562,8 @@ let trans_visitor
and get_tydesc (idopt:node_id option) (ty:Ast.ty) : Il.cell =
log cx "getting tydesc for %a" Ast.sprintf_ty ty;
let (ty, mut) = simplified_ty_innermost_was_mutable ty in
match ty with
let (ty', mut) = simplified_ty_innermost_was_mutable ty in
match ty' with
Ast.TY_param (idx, _) ->
(get_ty_param_in_current_frame idx)
| t when has_parametric_types t ->

View File

@ -0,0 +1,7 @@
fn leaky[T](T t) {
}
fn main() {
auto x = @10;
leaky[@int](x);
}