Rollup merge of #125551 - clarfonthey:ip-bits, r=jhpratt · model-checking/verify-rust-std@385e1b8

@@ -460,12 +460,11 @@ impl Ipv4Addr {

460460

/// # Examples

461461

///

462462

/// ```

463-

/// #![feature(ip_bits)]

464463

/// use std::net::Ipv4Addr;

465464

///

466465

/// assert_eq!(Ipv4Addr::BITS, 32);

467466

/// ```

468-

#[unstable(feature = "ip_bits", issue = "113744")]

467+

#[stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]

469468

pub const BITS: u32 = 32;

470469471470

/// Converts an IPv4 address into a `u32` representation using native byte order.

@@ -479,24 +478,22 @@ impl Ipv4Addr {

479478

/// # Examples

480479

///

481480

/// ```

482-

/// #![feature(ip_bits)]

483481

/// use std::net::Ipv4Addr;

484482

///

485483

/// let addr = Ipv4Addr::new(0x12, 0x34, 0x56, 0x78);

486484

/// assert_eq!(0x12345678, addr.to_bits());

487485

/// ```

488486

///

489487

/// ```

490-

/// #![feature(ip_bits)]

491488

/// use std::net::Ipv4Addr;

492489

///

493490

/// let addr = Ipv4Addr::new(0x12, 0x34, 0x56, 0x78);

494491

/// let addr_bits = addr.to_bits() & 0xffffff00;

495492

/// assert_eq!(Ipv4Addr::new(0x12, 0x34, 0x56, 0x00), Ipv4Addr::from_bits(addr_bits));

496493

///

497494

/// ```

498-

#[rustc_const_unstable(feature = "ip_bits", issue = "113744")]

499-

#[unstable(feature = "ip_bits", issue = "113744")]

495+

#[rustc_const_stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]

496+

#[stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]

500497

#[must_use]

501498

#[inline]

502499

pub const fn to_bits(self) -> u32 {

@@ -510,14 +507,13 @@ impl Ipv4Addr {

510507

/// # Examples

511508

///

512509

/// ```

513-

/// #![feature(ip_bits)]

514510

/// use std::net::Ipv4Addr;

515511

///

516512

/// let addr = Ipv4Addr::from(0x12345678);

517513

/// assert_eq!(Ipv4Addr::new(0x12, 0x34, 0x56, 0x78), addr);

518514

/// ```

519-

#[rustc_const_unstable(feature = "ip_bits", issue = "113744")]

520-

#[unstable(feature = "ip_bits", issue = "113744")]

515+

#[rustc_const_stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]

516+

#[stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]

521517

#[must_use]

522518

#[inline]

523519

pub const fn from_bits(bits: u32) -> Ipv4Addr {

@@ -1238,12 +1234,11 @@ impl Ipv6Addr {

12381234

/// # Examples

12391235

///

12401236

/// ```

1241-

/// #![feature(ip_bits)]

12421237

/// use std::net::Ipv6Addr;

12431238

///

12441239

/// assert_eq!(Ipv6Addr::BITS, 128);

12451240

/// ```

1246-

#[unstable(feature = "ip_bits", issue = "113744")]

1241+

#[stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]

12471242

pub const BITS: u32 = 128;

1248124312491244

/// Converts an IPv6 address into a `u128` representation using native byte order.

@@ -1257,7 +1252,6 @@ impl Ipv6Addr {

12571252

/// # Examples

12581253

///

12591254

/// ```

1260-

/// #![feature(ip_bits)]

12611255

/// use std::net::Ipv6Addr;

12621256

///

12631257

/// let addr = Ipv6Addr::new(

@@ -1268,7 +1262,6 @@ impl Ipv6Addr {

12681262

/// ```

12691263

///

12701264

/// ```

1271-

/// #![feature(ip_bits)]

12721265

/// use std::net::Ipv6Addr;

12731266

///

12741267

/// let addr = Ipv6Addr::new(

@@ -1284,8 +1277,8 @@ impl Ipv6Addr {

12841277

/// Ipv6Addr::from_bits(addr_bits));

12851278

///

12861279

/// ```

1287-

#[rustc_const_unstable(feature = "ip_bits", issue = "113744")]

1288-

#[unstable(feature = "ip_bits", issue = "113744")]

1280+

#[rustc_const_stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]

1281+

#[stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]

12891282

#[must_use]

12901283

#[inline]

12911284

pub const fn to_bits(self) -> u128 {

@@ -1299,7 +1292,6 @@ impl Ipv6Addr {

12991292

/// # Examples

13001293

///

13011294

/// ```

1302-

/// #![feature(ip_bits)]

13031295

/// use std::net::Ipv6Addr;

13041296

///

13051297

/// let addr = Ipv6Addr::from(0x102030405060708090A0B0C0D0E0F00D_u128);

@@ -1310,8 +1302,8 @@ impl Ipv6Addr {

13101302

/// ),

13111303

/// addr);

13121304

/// ```

1313-

#[rustc_const_unstable(feature = "ip_bits", issue = "113744")]

1314-

#[unstable(feature = "ip_bits", issue = "113744")]

1305+

#[rustc_const_stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]

1306+

#[stable(feature = "ip_bits", since = "CURRENT_RUSTC_VERSION")]

13151307

#[must_use]

13161308

#[inline]

13171309

pub const fn from_bits(bits: u128) -> Ipv6Addr {