about summary refs log tree commit diff
path: root/src/libstd/net
diff options
context:
space:
mode:
authorCorentin Henry <corentinhenry@gmail.com>2019-04-23 10:38:26 +0200
committerCorentin Henry <corentinhenry@gmail.com>2019-04-23 10:38:26 +0200
commit634dcd00b4f4a57cea0baae85d364d433897bf59 (patch)
tree8d728860849de5eae60e7a4a29d13cb906b5e08d /src/libstd/net
parent66627777b54843dc6c5630e27dd995258b05ac6d (diff)
downloadrust-634dcd00b4f4a57cea0baae85d364d433897bf59.tar.gz
rust-634dcd00b4f4a57cea0baae85d364d433897bf59.zip
std::net: add warning in Ipv6Addr::is_unicast_site_local() doc
site-local addresses are deprecated, so we should warn users about it.
Diffstat (limited to 'src/libstd/net')
-rw-r--r--src/libstd/net/ip.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstd/net/ip.rs b/src/libstd/net/ip.rs
index 1322733bb15..e3e257f5ac1 100644
--- a/src/libstd/net/ip.rs
+++ b/src/libstd/net/ip.rs
@@ -1335,6 +1335,14 @@ impl Ipv6Addr {
     ///     assert_eq!(Ipv6Addr::new(0xfec2, 0, 0, 0, 0, 0, 0, 0).is_unicast_site_local(), true);
     /// }
     /// ```
+    ///
+    /// # Warning
+    ///
+    /// As per [RFC 3879], the whole `FEC0::/10` prefix is
+    /// deprecated. New software must not support site-local
+    /// addresses.
+    ///
+    /// [RFC 3879]: https://tools.ietf.org/html/rfc3879
     pub fn is_unicast_site_local(&self) -> bool {
         (self.segments()[0] & 0xffc0) == 0xfec0
     }