about summary refs log tree commit diff
path: root/src/libstd/net_tcp.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2013-03-16 11:11:31 -0700
committerPatrick Walton <pcwalton@mimiga.net>2013-03-18 17:21:16 -0700
commite78f2e2ac577f9c47cd58af52d3bcd496254545d (patch)
treef05564837fe02f676458ea86b705709715c44017 /src/libstd/net_tcp.rs
parentc4db4faefaf13ac814f34c2a6cf105b7684de019 (diff)
downloadrust-e78f2e2ac577f9c47cd58af52d3bcd496254545d.tar.gz
rust-e78f2e2ac577f9c47cd58af52d3bcd496254545d.zip
librustc: Make the compiler ignore purity.
For bootstrapping purposes, this commit does not remove all uses of
the keyword "pure" -- doing so would cause the compiler to no longer
bootstrap due to some syntax extensions ("deriving" in particular).
Instead, it makes the compiler ignore "pure". Post-snapshot, we can
remove "pure" from the language.

There are quite a few (~100) borrow check errors that were essentially
all the result of mutable fields or partial borrows of `@mut`. Per
discussions with Niko I think we want to allow partial borrows of
`@mut` but detect obvious footguns. We should also improve the error
message when `@mut` is erroneously reborrowed.
Diffstat (limited to 'src/libstd/net_tcp.rs')
-rw-r--r--src/libstd/net_tcp.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstd/net_tcp.rs b/src/libstd/net_tcp.rs
index 54fbae956ce..a93e94e0d04 100644
--- a/src/libstd/net_tcp.rs
+++ b/src/libstd/net_tcp.rs
@@ -879,7 +879,8 @@ impl io::Reader for TcpSocketBuf {
 
           // If possible, copy up to `len` bytes from the internal
           // `data.buf` into `buf`
-          let nbuffered = self.data.buf.len() - self.data.buf_off;
+          let nbuffered = vec::uniq_len(&const self.data.buf) -
+                self.data.buf_off;
           let needed = len - count;
             if nbuffered > 0 {
                 unsafe {
@@ -931,7 +932,7 @@ impl io::Reader for TcpSocketBuf {
     }
     fn read_byte(&self) -> int {
         loop {
-          if self.data.buf.len() > self.data.buf_off {
+          if vec::uniq_len(&const self.data.buf) > self.data.buf_off {
             let c = self.data.buf[self.data.buf_off];
             self.data.buf_off += 1;
             return c as int