Skip to content

Commit 7b9e568

Browse files
committed
---
yaml --- r: 37274 b: refs/heads/try c: b18a151 h: refs/heads/master v: v3
1 parent 288509a commit 7b9e568

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
@@ -2,7 +2,7 @@
22
refs/heads/master: 09bb07bed9166105ea961a42b5fff7739ae0d2e9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5-
refs/heads/try: 4e03ffdb6547d9541de84b61d7798b497235472b
5+
refs/heads/try: b18a15171bfbcde81c44967a865214389d6fd7ad
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/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/try/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)