From 3ed9fbd63c6a3c6226bc466786e6d3c1bfec856d Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 29 Nov 2012 18:37:33 -0800 Subject: impls of traits cannot define methods on the anonymous trait --- src/libstd/map.rs | 4 +++- src/libstd/net_tcp.rs | 3 --- src/libstd/smallintmap.rs | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/map.rs b/src/libstd/map.rs index d68970679ad..b1909bfb067 100644 --- a/src/libstd/map.rs +++ b/src/libstd/map.rs @@ -390,7 +390,7 @@ pub mod chained { } } - impl T: ToStr { + impl T { fn to_writer(wr: io::Writer) { if self.count == 0u { wr.write_str(~"{}"); @@ -410,7 +410,9 @@ pub mod chained { }; wr.write_str(~" }"); } + } + impl T: ToStr { pure fn to_str() -> ~str unsafe { // Meh -- this should be safe do io::with_str_writer |wr| { self.to_writer(wr) } diff --git a/src/libstd/net_tcp.rs b/src/libstd/net_tcp.rs index 96897790fcd..966cbbb6c14 100644 --- a/src/libstd/net_tcp.rs +++ b/src/libstd/net_tcp.rs @@ -824,9 +824,6 @@ impl TcpSocketBuf: io::Reader { bytes[0] as int } } - fn unread_byte(amt: int) { - self.data.buf.unshift(amt as u8); - } fn eof() -> bool { self.end_of_stream } diff --git a/src/libstd/smallintmap.rs b/src/libstd/smallintmap.rs index 3f9d308584d..dd773d25687 100644 --- a/src/libstd/smallintmap.rs +++ b/src/libstd/smallintmap.rs @@ -101,7 +101,6 @@ impl SmallIntMap: map::Map { } pure fn get(key: uint) -> V { get(self, key) } pure fn find(key: uint) -> Option { find(self, key) } - fn rehash() { fail } fn update_with_key(key: uint, val: V, ff: fn(uint, V, V) -> V) -> bool { match self.find(key) { -- cgit 1.4.1-3-g733a5