about summary refs log tree commit diff
path: root/src/libstd/net_ip.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-07-11 15:00:40 -0700
committerPatrick Walton <pcwalton@mimiga.net>2012-07-17 15:46:43 -0700
commitdb020ab63cd51dd4a25cba2d00117f016128762b (patch)
tree2b6f1e99ba4356f3e3bf5338332c278d2a85109b /src/libstd/net_ip.rs
parentb5729bd60095fb5ca884936775e031cf19900760 (diff)
downloadrust-db020ab63cd51dd4a25cba2d00117f016128762b.tar.gz
rust-db020ab63cd51dd4a25cba2d00117f016128762b.zip
rustc: Implement and enforce instance coherence
Diffstat (limited to 'src/libstd/net_ip.rs')
-rw-r--r--src/libstd/net_ip.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstd/net_ip.rs b/src/libstd/net_ip.rs
index a78b6a5f172..f79a95d8ab5 100644
--- a/src/libstd/net_ip.rs
+++ b/src/libstd/net_ip.rs
@@ -148,7 +148,12 @@ mod v4 {
     // the simple, old style numberic representation of
     // ipv4
     type ipv4_rep = { a: u8, b: u8, c: u8, d:u8 };
-    impl x for ipv4_rep {
+
+    trait as_unsafe_u32 {
+        unsafe fn as_u32() -> u32;
+    }
+
+    impl x of as_unsafe_u32 for ipv4_rep {
         // this is pretty dastardly, i know
         unsafe fn as_u32() -> u32 {
             *((ptr::addr_of(self)) as *u32)