Skip to content

Commit 65e461c

Browse files
committed
---
yaml --- r: 130986 b: refs/heads/try c: 2fdad65 h: refs/heads/master v: v3
1 parent cf1fb51 commit 65e461c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 9c68679f2ebd5b165694e9346e4ad96a3e32aceb
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6faa4f33a42de32579e02a8d030db920d360e2b5
5-
refs/heads/try: d1bd139251be4b1c51ace8d180757ca7b59e675a
5+
refs/heads/try: 2fdad65a057d9b6cd159623ebeba131ec32f69dd
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libsyntax/owned_slice.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,12 @@ impl<T> OwnedSlice<T> {
5858
if len == 0 {
5959
OwnedSlice::empty()
6060
} else {
61+
// drop excess capacity to avoid breaking sized deallocation
62+
v.shrink_to_fit();
63+
6164
let p = v.as_mut_ptr();
6265
// we own the allocation now
63-
unsafe {mem::forget(v)}
66+
unsafe { mem::forget(v) }
6467

6568
OwnedSlice { data: p, len: len }
6669
}

0 commit comments

Comments
 (0)