about summary refs log tree commit diff
path: root/src/boot
diff options
context:
space:
mode:
authorRoy Frostig <rfrostig@mozilla.com>2010-09-07 00:54:23 -0700
committerRoy Frostig <rfrostig@mozilla.com>2010-09-07 00:54:23 -0700
commit5e5112dac672d2364e446faf55a8fb326d53e741 (patch)
tree8d3faf732190cb31cf92c604ae8c0669942f153b /src/boot
parentcf62b54028ef949298fc38a815f5f0a3e1666261 (diff)
downloadrust-5e5112dac672d2364e446faf55a8fb326d53e741.tar.gz
rust-5e5112dac672d2364e446faf55a8fb326d53e741.zip
Recursively drop a type's parts if the type uses any typarams, since those typarams may represent types that actually require dropping.
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/me/trans.ml8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/boot/me/trans.ml b/src/boot/me/trans.ml
index b015ca6d1c7..7b89fc5a3b2 100644
--- a/src/boot/me/trans.ml
+++ b/src/boot/me/trans.ml
@@ -2883,11 +2883,13 @@ let trans_visitor
                   patch null_jmp;
                   note_drop_step ty "drop_ty: done box-drop path";
 
-            | MEM_interior when type_points_to_heap ty ->
-                note_drop_step ty "drop_ty heap-referencing path";
+            | MEM_interior
+                when type_points_to_heap ty || (n_used_type_params ty > 0) ->
+                note_drop_step ty "drop_ty possibly-heap-referencing path";
                 iter_ty_parts ty_params cell ty
                   (drop_ty ty_params) curr_iso;
-                note_drop_step ty "drop_ty: done heap-referencing path";
+                note_drop_step ty
+                  "drop_ty: done possibly-heap-referencing path";
 
 
             | MEM_interior ->