Change:
Tracking issue for First needs to be implemented, then go through an FCP! Looks like the is being implemented over at
This issue is now entering a cycle-long final comment period for stabilization
Discussed recently, the libs team decided to stabilize.

Discussion:
_ => None } } <ins> /// Returns the sixteen eight-bit integers the IPv6 address consists of. #[unstable(feature = "ipv6_to_octets", reason = "needs some testing", issue = "32313")] pub fn octets(&self) -> [u8; 16] { self.inner.s6_addr } </ins> } #[stable(feature = "rust1", since = "1.0.0")]

} } <ins> #[stable(feature = "ipv6_from_octets", since = "1.9.0")] impl From<[u8; 16]> for Ipv6Addr { fn from(octets: [u8; 16]) -> Ipv6Addr { let mut inner: c::in6_addr = unsafe { mem::zeroed() }; inner.s6_addr = octets; Ipv6Addr::from_inner(inner) } } </ins> // Tests for this module #[cfg(test)] mod tests {

//    address                unspec loopbk privt  linloc global multicast brdcast doc check(&[0, 0, 0, 0],         true,  false, false, false, false,  false,    false,  false); check(&[0, 0, 0, 1],         false, false, false, false, true,   false,    false,  false); <del> check(&[1, 0, 0, 0],         false, false, false, false, true,   false,    false,  false); </del> <ins> check(&[0, 1, 0, 0],         false, false, false, false, true,   false,    false,  false); </ins> check(&[10, 9, 8, 7],        false, false, true,  false, false,  false,    false,  false); check(&[127, 1, 2, 3],       false, true,  false, false, false,  false,    false,  false); check(&[172, 31, 254, 253],  false, false, true,  false, false,  false,    false,  false);

#[test] fn ipv6_properties() { <del> fn check(str_addr: &str, unspec: bool, loopback: bool, </del> <ins> fn check(str_addr: &str, octets: &[u8; 16], unspec: bool, loopback: bool, </ins> unique_local: bool, global: bool, u_link_local: bool, u_site_local: bool, u_global: bool, u_doc: bool, m_scope: Option<Ipv6MulticastScope>) { let ip: Ipv6Addr = str_addr.parse().unwrap(); assert_eq!(str_addr, ip.to_string()); <ins> assert_eq!(&ip.octets(), octets); assert_eq!(Ipv6Addr::from(*octets), ip); </ins> assert_eq!(ip.is_unspecified(), unspec); assert_eq!(ip.is_loopback(), loopback);

assert_eq!(ip.is_multicast(), m_scope.is_some()); } <del> //    unspec loopbk uniqlo global unill  unisl  uniglo  doc    mscope check("::", true,  false, false, false,  false, false, false, false, None); check("::1", false, true,  false, false, false, false,  false, false, None); check("::0.0.0.2", </del> <ins> //    unspec loopbk uniqlo global unill  unisl  uniglo doc    mscope check("::", &[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], true,  false, false, false, false, false, false, false, None); check("::1", &[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], false, true,  false, false, false, false, false, false, None); check("::0.0.0.2", &[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2], </ins> false, false, false, true,  false, false, true,  false, None); <del> check("1::", </del> <ins> check("1::", &[0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], </ins> false, false, false, true,  false, false, true,  false, None); <del> check("fc00::", </del> <ins> check("fc00::", &[0xfc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], </ins> false, false, true,  false, false, false, false, false, None); <del> check("fdff:ffff::", </del> <ins> check("fdff:ffff::", &[0xfd, 0xff, 0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], </ins> false, false, true,  false, false, false, false, false, None); <del> check("fe80:ffff::", </del> <ins> check("fe80:ffff::", &[0xfe, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], </ins> false, false, false, false, true,  false, false, false, None); <del> check("febf:ffff::", </del> <ins> check("febf:ffff::", &[0xfe, 0xbf, 0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], </ins> false, false, false, false, true,  false, false, false, None); <del> check("fec0::", </del> <ins> check("fec0::", &[0xfe, 0xc0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], </ins> false, false, false, false, false, true,  false, false, None); <del> check("ff01::", </del> <ins> check("ff01::", &[0xff, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], </ins> false, false, false, false, false, false, false, false, Some(InterfaceLocal)); <del> check("ff02::", </del> <ins> check("ff02::", &[0xff, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], </ins> false, false, false, false, false, false, false, false, Some(LinkLocal)); <del> check("ff03::", </del> <ins> check("ff03::", &[0xff, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], </ins> false, false, false, false, false, false, false, false, Some(RealmLocal)); <del> check("ff04::", </del> <ins> check("ff04::", &[0xff, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], </ins> false, false, false, false, false, false, false, false, Some(AdminLocal)); <del> check("ff05::", </del> <ins> check("ff05::", &[0xff, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], </ins> false, false, false, false, false, false, false, false, Some(SiteLocal)); <del> check("ff08::", </del> <ins> check("ff08::", &[0xff, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], </ins> false, false, false, false, false, false, false, false, Some(OrganizationLocal)); <del> check("ff0e::", </del> <ins> check("ff0e::", &[0xff, 0xe, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], </ins> false, false, false, true,  false, false, false, false, Some(Global)); check("2001:db8:85a3::8a2e:370:7334", <ins> &[0x20, 1, 0xd, 0xb8, 0x85, 0xa3, 0, 0, 0, 0, 0x8a, 0x2e, 3, 0x70, 0x73, 0x34], </ins> false, false, false, false, false, false, false, true, None); <ins> check("102:304:506:708:90a:b0c:d0e:f10", &[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], false, false, false, true,  false, false, true,  false, None); </ins> } #[test]