Fix a leak when box types are used via type descriptors.
This commit is contained in:
parent
a493350eb5
commit
67aa39e1ef
@ -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 \
|
||||
|
@ -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 ->
|
||||
|
7
src/test/run-pass/leak-box-as-tydesc.rs
Normal file
7
src/test/run-pass/leak-box-as-tydesc.rs
Normal file
@ -0,0 +1,7 @@
|
||||
fn leaky[T](T t) {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
auto x = @10;
|
||||
leaky[@int](x);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user