Skip to content

Commit 17b65dd

Browse files
committed
---
yaml --- r: 102817 b: refs/heads/auto c: 838c62b h: refs/heads/master i: 102815: fbec7ae v: v3
1 parent 76b7f36 commit 17b65dd

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: cb1fad3b28475eceff3de26380297a2c92fe5deb
16+
refs/heads/auto: 838c62bb288d0fa6b395a9807ad8a519406e48c3
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libstd/io/net/ip.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ use iter::Iterator;
1414
use option::{Option, None, Some};
1515
use str::StrSlice;
1616
use to_str::ToStr;
17+
use to_bytes::IterBytes;
1718
use vec::{MutableCloneableVector, ImmutableVector, MutableVector};
1819

1920
pub type Port = u16;
2021

21-
#[deriving(Eq, TotalEq, Clone)]
22+
#[deriving(Eq, TotalEq, Clone, IterBytes)]
2223
pub enum IpAddr {
2324
Ipv4Addr(u8, u8, u8, u8),
2425
Ipv6Addr(u16, u16, u16, u16, u16, u16, u16, u16)
@@ -48,7 +49,7 @@ impl ToStr for IpAddr {
4849
}
4950
}
5051

51-
#[deriving(Eq, TotalEq, Clone)]
52+
#[deriving(Eq, TotalEq, Clone, IterBytes)]
5253
pub struct SocketAddr {
5354
ip: IpAddr,
5455
port: Port,
@@ -339,6 +340,7 @@ impl FromStr for SocketAddr {
339340
mod test {
340341
use prelude::*;
341342
use super::*;
343+
use to_bytes::ToBytes;
342344

343345
#[test]
344346
fn test_from_str_ipv4() {
@@ -441,4 +443,13 @@ mod test {
441443
assert_eq!(Ipv6Addr(8, 9, 10, 11, 12, 13, 14, 15).to_str(), ~"8:9:a:b:c:d:e:f");
442444
}
443445

446+
#[test]
447+
fn ipv4_addr_to_bytes() {
448+
Ipv4Addr(123, 20, 12, 56).to_bytes(true);
449+
}
450+
451+
#[test]
452+
fn socket_addr_to_bytes() {
453+
SocketAddr { ip: Ipv4Addr(1, 2, 3, 4), port: 1234 }.to_bytes(true);
454+
}
444455
}

branches/auto/src/test/compile-fail/regions-variance-contravariant-use-covariant.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
// variance inference works in the first place.
1616

1717
// This is contravariant with respect to 'a, meaning that
18-
// Contravariant<'foo> <: Contravariant<'static> because
19-
// 'foo <= 'static
18+
// Contravariant<'long> <: Contravariant<'short> iff
19+
// 'short <= 'long
2020
struct Contravariant<'a> {
2121
f: &'a int
2222
}

0 commit comments

Comments
 (0)