未验证 提交 fa3d56ac 编写于 作者: K kennytm 提交者: GitHub

Rollup merge of #53213 - tmccombs:stable-ipconstructors, r=KodrAus

Stabilize IP associated constants

Fixes #44582
......@@ -357,15 +357,12 @@ pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
/// # Examples
///
/// ```
/// #![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")]
#[stable(feature = "ip_constructors", since = "1.30.0")]
pub const LOCALHOST: Self = Ipv4Addr::new(127, 0, 0, 1);
/// An IPv4 address representing an unspecified address: 0.0.0.0
......@@ -373,15 +370,12 @@ pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
/// # Examples
///
/// ```
/// #![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")]
#[stable(feature = "ip_constructors", since = "1.30.0")]
pub const UNSPECIFIED: Self = Ipv4Addr::new(0, 0, 0, 0);
/// An IPv4 address representing the broadcast address: 255.255.255.255
......@@ -389,15 +383,12 @@ pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr {
/// # Examples
///
/// ```
/// #![feature(ip_constructors)]
/// use std::net::Ipv4Addr;
///
/// let addr = Ipv4Addr::BROADCAST;
/// assert_eq!(addr, Ipv4Addr::new(255, 255, 255, 255));
/// ```
#[unstable(feature = "ip_constructors",
reason = "requires greater scrutiny before stabilization",
issue = "44582")]
#[stable(feature = "ip_constructors", since = "1.30.0")]
pub const BROADCAST: Self = Ipv4Addr::new(255, 255, 255, 255);
/// Returns the four eight-bit integers that make up this address.
......@@ -896,15 +887,12 @@ pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16,
/// # Examples
///
/// ```
/// #![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")]
#[stable(feature = "ip_constructors", since = "1.30.0")]
pub const LOCALHOST: Self = Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1);
/// An IPv6 address representing the unspecified address: `::`
......@@ -912,15 +900,12 @@ pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16,
/// # Examples
///
/// ```
/// #![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")]
#[stable(feature = "ip_constructors", since = "1.30.0")]
pub const UNSPECIFIED: Self = Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0);
/// Returns the eight 16-bit segments that make up this address.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册