Skip to content

Commit 11be22e

Browse files
committed
---
yaml --- r: 35993 b: refs/heads/try2 c: b18a151 h: refs/heads/master i: 35991: fa43a25 v: v3
1 parent 291fe1a commit 11be22e

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
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: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 4e03ffdb6547d9541de84b61d7798b497235472b
8+
refs/heads/try2: b18a15171bfbcde81c44967a865214389d6fd7ad
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/src/libcore/dvec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub enum DVec<A> {
5656
}
5757

5858
/// Creates a new, empty dvec
59-
pub fn DVec<A>() -> DVec<A> {
59+
pub pure fn DVec<A>() -> DVec<A> {
6060
DVec_({mut data: ~[]})
6161
}
6262

branches/try2/src/libcore/io.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ impl ByteBuf: Reader {
328328
fn tell() -> uint { self.pos }
329329
}
330330

331-
pub fn with_bytes_reader<t>(bytes: &[u8], f: fn(Reader) -> t) -> t {
331+
pub pure fn with_bytes_reader<t>(bytes: &[u8], f: fn(Reader) -> t) -> t {
332332
f({buf: bytes, mut pos: 0u} as Reader)
333333
}
334334

@@ -730,21 +730,25 @@ impl @BytesWriter : Writer {
730730
fn get_type() -> WriterType { (*self).get_type() }
731731
}
732732
733-
pub fn BytesWriter() -> BytesWriter {
733+
pub pure fn BytesWriter() -> BytesWriter {
734734
BytesWriter { buf: DVec(), mut pos: 0u }
735735
}
736736
737-
pub fn with_bytes_writer(f: fn(Writer)) -> ~[u8] {
737+
pub pure fn with_bytes_writer(f: fn(Writer)) -> ~[u8] {
738738
let wr = @BytesWriter();
739739
f(wr as Writer);
740-
wr.buf.check_out(|buf| move buf)
740+
// FIXME (#3758): This should not be needed.
741+
unsafe { wr.buf.check_out(|buf| move buf) }
741742
}
742743
743-
pub fn with_str_writer(f: fn(Writer)) -> ~str {
744+
pub pure fn with_str_writer(f: fn(Writer)) -> ~str {
744745
let mut v = with_bytes_writer(f);
745746
746-
// Make sure the vector has a trailing null and is proper utf8.
747-
v.push(0);
747+
// FIXME (#3758): This should not be needed.
748+
unsafe {
749+
// Make sure the vector has a trailing null and is proper utf8.
750+
v.push(0);
751+
}
748752
assert str::is_utf8(v);
749753
750754
unsafe { move ::cast::transmute(move v) }

0 commit comments

Comments
 (0)