@@ -402,7 +402,7 @@ impl Ipv4Addr {
402402 /// assert_eq!(addr.octets(), [127, 0, 0, 1]);
403403 /// ```
404404 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
405- pub fn octets ( & self ) -> [ u8 ; 4 ] {
405+ pub fn octets ( & self ) -> [ u8 ; 4 ] {
406406 let bits = u32:: from_be ( self . inner . s_addr ) ;
407407 [ ( bits >> 24 ) as u8 , ( bits >> 16 ) as u8 , ( bits >> 8 ) as u8 , bits as u8 ]
408408 }
@@ -424,7 +424,7 @@ impl Ipv4Addr {
424424 /// assert_eq!(Ipv4Addr::new(45, 22, 13, 197).is_unspecified(), false);
425425 /// ```
426426 #[ stable( feature = "ip_shared" , since = "1.12.0" ) ]
427- pub fn is_unspecified ( & self ) -> bool {
427+ pub const fn is_unspecified ( & self ) -> bool {
428428 self . inner . s_addr == 0
429429 }
430430
@@ -862,7 +862,6 @@ impl Ipv6Addr {
862862 /// let addr = Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff);
863863 /// ```
864864 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
865- #[ rustc_const_unstable( feature = "const_ip" ) ]
866865 pub const fn new ( a : u16 , b : u16 , c : u16 , d : u16 , e : u16 , f : u16 ,
867866 g : u16 , h : u16 ) -> Ipv6Addr {
868867 Ipv6Addr {
@@ -1224,7 +1223,7 @@ impl Ipv6Addr {
12241223 /// [255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
12251224 /// ```
12261225 #[ stable( feature = "ipv6_to_octets" , since = "1.12.0" ) ]
1227- pub fn octets ( & self ) -> [ u8 ; 16 ] {
1226+ pub const fn octets ( & self ) -> [ u8 ; 16 ] {
12281227 self . inner . s6_addr
12291228 }
12301229}
0 commit comments