Skip to content

Commit 69aedae

Browse files
committed
---
yaml --- r: 58222 b: refs/heads/auto c: 92d2ec4 h: refs/heads/master v: v3
1 parent 906881f commit 69aedae

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: da2ac908126ec52e60e621416ce84284e7b77e51
17+
refs/heads/auto: 92d2ec4d32c7f7722569b1463cba31c6402f7513
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/libstd/flatpipes.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -558,9 +558,11 @@ pub mod bytepipes {
558558
}
559559
}
560560
561+
// XXX: Remove `@mut` when this module is ported to the new I/O traits,
562+
// which use `&mut self` properly.
561563
pub struct PipeBytePort {
562564
port: comm::Port<~[u8]>,
563-
mut buf: ~[u8]
565+
buf: @mut ~[u8]
564566
}
565567
566568
pub struct PipeByteChan {
@@ -569,13 +571,13 @@ pub mod bytepipes {
569571
570572
impl BytePort for PipeBytePort {
571573
fn try_recv(&self, count: uint) -> Option<~[u8]> {
572-
if vec::uniq_len(&const self.buf) >= count {
573-
let mut bytes = ::core::util::replace(&mut self.buf, ~[]);
574-
self.buf = bytes.slice(count, bytes.len()).to_owned();
574+
if vec::uniq_len(&const *self.buf) >= count {
575+
let mut bytes = ::core::util::replace(&mut *self.buf, ~[]);
576+
*self.buf = bytes.slice(count, bytes.len()).to_owned();
575577
bytes.truncate(count);
576578
return Some(bytes);
577-
} else if vec::uniq_len(&const self.buf) > 0 {
578-
let mut bytes = ::core::util::replace(&mut self.buf, ~[]);
579+
} else if vec::uniq_len(&const *self.buf) > 0 {
580+
let mut bytes = ::core::util::replace(&mut *self.buf, ~[]);
579581
assert!(count > bytes.len());
580582
match self.try_recv(count - bytes.len()) {
581583
Some(rest) => {
@@ -584,11 +586,11 @@ pub mod bytepipes {
584586
}
585587
None => return None
586588
}
587-
} else if vec::uniq_len(&const self.buf) == 0 {
589+
} else if vec::uniq_len(&const *self.buf) == 0 {
588590
match self.port.try_recv() {
589591
Some(buf) => {
590592
assert!(!buf.is_empty());
591-
self.buf = buf;
593+
*self.buf = buf;
592594
return self.try_recv(count);
593595
}
594596
None => return None
@@ -609,7 +611,7 @@ pub mod bytepipes {
609611
fn new(p: Port<~[u8]>) -> PipeBytePort {
610612
PipeBytePort {
611613
port: p,
612-
buf: ~[]
614+
buf: @mut ~[]
613615
}
614616
}
615617
}

branches/auto/src/libstd/io_util.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ use core::io;
1313

1414
pub struct BufReader {
1515
buf: ~[u8],
16-
mut pos: uint
16+
pos: @mut uint
1717
}
1818

1919
pub impl BufReader {
2020
pub fn new(v: ~[u8]) -> BufReader {
2121
BufReader {
2222
buf: v,
23-
pos: 0
23+
pos: @mut 0
2424
}
2525
}
2626

@@ -29,13 +29,13 @@ pub impl BufReader {
2929
// I can't get the borrowing to work correctly
3030
let bytes_reader = BytesReader {
3131
bytes: ::core::util::id::<&[u8]>(self.buf),
32-
pos: self.pos
32+
pos: *self.pos
3333
};
3434

3535
let res = f(&bytes_reader);
3636

3737
// FIXME #4429: This isn't correct if f fails
38-
self.pos = bytes_reader.pos;
38+
*self.pos = bytes_reader.pos;
3939

4040
return res;
4141
}

0 commit comments

Comments
 (0)