diff options
| author | bors <bors@rust-lang.org> | 2019-12-14 10:21:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-12-14 10:21:32 +0000 |
| commit | c8ea4ace9213ae045123fdfeb59d1ac887656d31 (patch) | |
| tree | 2a7d207294b6f2c99d1ddbe193b1d5af8ee46a09 /src/libstd/net | |
| parent | 12307b3b08edee543a78fb9d4a837fbd6d6ac0fa (diff) | |
| parent | 0b47ba7019adf06f6687a8c94040e63ae1ea4fba (diff) | |
| download | rust-c8ea4ace9213ae045123fdfeb59d1ac887656d31.tar.gz rust-c8ea4ace9213ae045123fdfeb59d1ac887656d31.zip | |
Auto merge of #67136 - oli-obk:const_stability, r=Centril
Require stable/unstable annotations for the constness of all stable fns with a const modifier r? @RalfJung @Centril Every `#[stable]` const fn now needs either a `#[rustc_const_unstable]` attribute or a `#[rustc_const_stable]` attribute. You can't silently stabilize the constness of a function anymore.
Diffstat (limited to 'src/libstd/net')
| -rw-r--r-- | src/libstd/net/ip.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstd/net/ip.rs b/src/libstd/net/ip.rs index e51a9b62449..7d69f8f4b8d 100644 --- a/src/libstd/net/ip.rs +++ b/src/libstd/net/ip.rs @@ -319,6 +319,7 @@ impl Ipv4Addr { /// let addr = Ipv4Addr::new(127, 0, 0, 1); /// ``` #[stable(feature = "rust1", since = "1.0.0")] + #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_ipv4", since = "1.32.0"))] pub const fn new(a: u8, b: u8, c: u8, d: u8) -> Ipv4Addr { // FIXME: should just be u32::from_be_bytes([a, b, c, d]), // once that method is no longer rustc_const_unstable @@ -406,6 +407,7 @@ impl Ipv4Addr { /// assert_eq!(Ipv4Addr::new(45, 22, 13, 197).is_unspecified(), false); /// ``` #[stable(feature = "ip_shared", since = "1.12.0")] + #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_ipv4", since = "1.32.0"))] pub const fn is_unspecified(&self) -> bool { self.inner.s_addr == 0 } @@ -1015,6 +1017,7 @@ impl Ipv6Addr { /// let addr = Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff); /// ``` #[stable(feature = "rust1", since = "1.0.0")] + #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_ipv6", since = "1.32.0"))] pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16) -> Ipv6Addr { Ipv6Addr { @@ -1480,6 +1483,7 @@ impl Ipv6Addr { /// [255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); /// ``` #[stable(feature = "ipv6_to_octets", since = "1.12.0")] + #[cfg_attr(not(bootstrap), rustc_const_stable(feature = "const_ipv6", since = "1.32.0"))] pub const fn octets(&self) -> [u8; 16] { self.inner.s6_addr } |
