Skip to content

Commit 97c2255

Browse files
committed
Use truncate in typeck::infer; gets rid of FIXME
1 parent acaad93 commit 97c2255

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/rustc/middle/typeck/infer.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -565,11 +565,8 @@ impl infer_ctxt {
565565
do indent {
566566
let r <- self.try(f);
567567

568-
// FIXME (#2814)---could use a vec::clear() that ran
569-
// destructors but kept the vec at its currently allocated
570-
// length
571-
self.ty_var_bindings.bindings = ~[];
572-
self.int_var_bindings.bindings = ~[];
568+
self.ty_var_bindings.bindings.truncate(0);
569+
self.int_var_bindings.bindings.truncate(0);
573570
self.region_vars.commit();
574571
move r
575572
}

0 commit comments

Comments
 (0)