Skip to content

Commit 06bfcd9

Browse files
author
James Miller
committed
---
yaml --- r: 140645 b: refs/heads/try2 c: f5ab112 h: refs/heads/master i: 140643: babd7d8 v: v3
1 parent d3b978e commit 06bfcd9

File tree

5 files changed

+10
-15
lines changed

5 files changed

+10
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 050c744c23a8e01407452bc64ca63f92554afee2
8+
refs/heads/try2: f5ab112e6b083ab20fdcf9e2fff7dde4a85940b0
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libcore/cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub mod rusti {
2525

2626
/// Casts the value at `src` to U. The two types must have the same length.
2727
pub unsafe fn transmute_copy<T, U>(src: &T) -> U {
28-
let mut dest: U = unstable::intrinsics::init();
28+
let mut dest: U = unstable::intrinsics::uninit();
2929
{
3030
let dest_ptr: *mut u8 = rusti::transmute(&mut dest);
3131
let src_ptr: *u8 = rusti::transmute(src);

branches/try2/src/libcore/vec.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,7 @@ pub fn pop<T>(v: &mut ~[T]) -> T {
591591
}
592592
let valptr = ptr::to_mut_unsafe_ptr(&mut v[ln - 1u]);
593593
unsafe {
594-
// FIXME #4204: Should be uninit() - we don't need this zeroed
595-
let mut val = intrinsics::init();
594+
let mut val = intrinsics::uninit();
596595
val <-> *valptr;
597596
raw::set_len(v, ln - 1u);
598597
val
@@ -666,8 +665,7 @@ pub fn push_all_move<T>(v: &mut ~[T], mut rhs: ~[T]) {
666665
unsafe {
667666
do as_mut_buf(rhs) |p, len| {
668667
for uint::range(0, len) |i| {
669-
// FIXME #4204 Should be uninit() - don't need to zero
670-
let mut x = intrinsics::init();
668+
let mut x = intrinsics::uninit();
671669
x <-> *ptr::mut_offset(p, i);
672670
push(&mut *v, x);
673671
}
@@ -683,8 +681,7 @@ pub fn truncate<T>(v: &mut ~[T], newlen: uint) {
683681
unsafe {
684682
// This loop is optimized out for non-drop types.
685683
for uint::range(newlen, oldlen) |i| {
686-
// FIXME #4204 Should be uninit() - don't need to zero
687-
let mut dropped = intrinsics::init();
684+
let mut dropped = intrinsics::uninit();
688685
dropped <-> *ptr::mut_offset(p, i);
689686
}
690687
}
@@ -709,9 +706,7 @@ pub fn dedup<T:Eq>(v: &mut ~[T]) {
709706
// last_written < next_to_read < ln
710707
if *ptr::mut_offset(p, next_to_read) ==
711708
*ptr::mut_offset(p, last_written) {
712-
// FIXME #4204 Should be uninit() - don't need to
713-
// zero
714-
let mut dropped = intrinsics::init();
709+
let mut dropped = intrinsics::uninit();
715710
dropped <-> *ptr::mut_offset(p, next_to_read);
716711
} else {
717712
last_written += 1;

branches/try2/src/libstd/priority_queue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ pub impl <T:Ord> PriorityQueue<T> {
139139
while pos > start {
140140
let parent = (pos - 1) >> 1;
141141
if new > self.data[parent] {
142-
let mut x = rusti::init();
142+
let mut x = rusti::uninit();
143143
x <-> self.data[parent];
144144
rusti::move_val_init(&mut self.data[pos], x);
145145
pos = parent;
@@ -162,7 +162,7 @@ pub impl <T:Ord> PriorityQueue<T> {
162162
if right < end && !(self.data[child] > self.data[right]) {
163163
child = right;
164164
}
165-
let mut x = rusti::init();
165+
let mut x = rusti::uninit();
166166
x <-> self.data[child];
167167
rusti::move_val_init(&mut self.data[pos], x);
168168
pos = child;

branches/try2/src/libstd/rc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<T: Owned> Drop for Rc<T> {
5151
unsafe {
5252
(*self.ptr).count -= 1;
5353
if (*self.ptr).count == 0 {
54-
let mut x = intrinsics::init();
54+
let mut x = intrinsics::uninit();
5555
x <-> *self.ptr;
5656
free(self.ptr as *c_void)
5757
}
@@ -159,7 +159,7 @@ impl<T: Owned> Drop for RcMut<T> {
159159
unsafe {
160160
(*self.ptr).count -= 1;
161161
if (*self.ptr).count == 0 {
162-
let mut x = rusti::init();
162+
let mut x = rusti::uninit();
163163
x <-> *self.ptr;
164164
free(self.ptr as *c_void)
165165
}

0 commit comments

Comments
 (0)