Skip to content

Commit

Permalink
Add unstable attributes for Ipv?Addr constructors.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcdyer committed Sep 15, 2017
1 parent 8b6122f commit 9d5b0e1
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions src/libstd/net/ip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#![unstable(feature = "ip", reason = "extra functionality has not been \
scrutinized to the level that it should \
be stable",
be to be stable",
issue = "27709")]

use cmp::Ordering;
Expand Down Expand Up @@ -347,12 +347,15 @@ impl Ipv4Addr {
/// # Examples
///
/// ```
/// #![feature(ip)]
/// #![feature(ip_constructors)]
/// use std::net::Ipv4Addr;
///
/// let addr = Ipv4Addr::localhost();
/// assert_eq!(addr, Ipv4Addr::new(127, 0, 0, 1));
/// ```
#[unstable(feature = "ip_constructors",
reason = "requires greater scrutiny before stabilization",
issue = "44582")]
pub fn localhost() -> Ipv4Addr {
Ipv4Addr::new(127, 0, 0, 1)
}
Expand All @@ -362,12 +365,15 @@ impl Ipv4Addr {
/// # Examples
///
/// ```
/// #![feature(ip)]
/// #![feature(ip_constructors)]
/// use std::net::Ipv4Addr;
///
/// let addr = Ipv4Addr::unspecified();
/// assert_eq!(addr, Ipv4Addr::new(0, 0, 0, 0));
/// ```
#[unstable(feature = "ip_constructors",
reason = "requires greater scrutiny before stabilization",
issue = "44582")]
pub fn unspecified() -> Ipv4Addr {
Ipv4Addr::new(0, 0, 0, 0)
}
Expand Down Expand Up @@ -823,12 +829,15 @@ impl Ipv6Addr {
/// # Examples
///
/// ```
/// #![feature(ip)]
/// #![feature(ip_constructors)]
/// use std::net::Ipv6Addr;
///
/// let addr = Ipv6Addr::localhost();
/// assert_eq!(addr, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
/// ```
#[unstable(feature = "ip_constructors",
reason = "requires greater scrutiny before stabilization",
issue = "44582")]
pub fn localhost() -> Ipv6Addr {
Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1)
}
Expand All @@ -838,12 +847,15 @@ impl Ipv6Addr {
/// # Examples
///
/// ```
/// #![feature(ip)]
/// #![feature(ip_constructors)]
/// use std::net::Ipv6Addr;
///
/// let addr = Ipv6Addr::unspecified();
/// assert_eq!(addr, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0));
/// ```
#[unstable(feature = "ip_constructors",
reason = "requires greater scrutiny before stabilization",
issue = "44582")]
pub fn unspecified() -> Ipv6Addr {
Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0)
}
Expand Down

0 comments on commit 9d5b0e1

Please sign in to comment.