mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Rollup merge of #138129 - RalfJung:stabilize-const-things, r=tgross35
Stabilize const_char_classify, const_sockaddr_setters FCP for const_char_classify: #132241 FCP for const_sockaddr_setters: #131714 Fixes #132241 Fixes #131714 Cc ``@rust-lang/wg-const-eval``
This commit is contained in:
commit
c33e9d6844
@ -337,7 +337,7 @@ impl char {
|
||||
/// '1'.is_digit(1);
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[rustc_const_unstable(feature = "const_char_classify", issue = "132241")]
|
||||
#[rustc_const_stable(feature = "const_char_classify", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[inline]
|
||||
pub const fn is_digit(self, radix: u32) -> bool {
|
||||
self.to_digit(radix).is_some()
|
||||
@ -886,7 +886,7 @@ impl char {
|
||||
/// ```
|
||||
#[must_use]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[rustc_const_unstable(feature = "const_char_classify", issue = "132241")]
|
||||
#[rustc_const_stable(feature = "const_char_classify", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[inline]
|
||||
pub const fn is_whitespace(self) -> bool {
|
||||
match self {
|
||||
|
@ -200,7 +200,7 @@ impl SocketAddr {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "sockaddr_setters", since = "1.9.0")]
|
||||
#[rustc_const_unstable(feature = "const_sockaddr_setters", issue = "131714")]
|
||||
#[rustc_const_stable(feature = "const_sockaddr_setters", since = "CURRENT_RUSTC_VERSION")]
|
||||
pub const fn set_ip(&mut self, new_ip: IpAddr) {
|
||||
// `match (*self, new_ip)` would have us mutate a copy of self only to throw it away.
|
||||
match (self, new_ip) {
|
||||
@ -244,7 +244,7 @@ impl SocketAddr {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "sockaddr_setters", since = "1.9.0")]
|
||||
#[rustc_const_unstable(feature = "const_sockaddr_setters", issue = "131714")]
|
||||
#[rustc_const_stable(feature = "const_sockaddr_setters", since = "CURRENT_RUSTC_VERSION")]
|
||||
pub const fn set_port(&mut self, new_port: u16) {
|
||||
match *self {
|
||||
SocketAddr::V4(ref mut a) => a.set_port(new_port),
|
||||
@ -350,7 +350,7 @@ impl SocketAddrV4 {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "sockaddr_setters", since = "1.9.0")]
|
||||
#[rustc_const_unstable(feature = "const_sockaddr_setters", issue = "131714")]
|
||||
#[rustc_const_stable(feature = "const_sockaddr_setters", since = "CURRENT_RUSTC_VERSION")]
|
||||
pub const fn set_ip(&mut self, new_ip: Ipv4Addr) {
|
||||
self.ip = new_ip;
|
||||
}
|
||||
@ -386,7 +386,7 @@ impl SocketAddrV4 {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "sockaddr_setters", since = "1.9.0")]
|
||||
#[rustc_const_unstable(feature = "const_sockaddr_setters", issue = "131714")]
|
||||
#[rustc_const_stable(feature = "const_sockaddr_setters", since = "CURRENT_RUSTC_VERSION")]
|
||||
pub const fn set_port(&mut self, new_port: u16) {
|
||||
self.port = new_port;
|
||||
}
|
||||
@ -448,7 +448,7 @@ impl SocketAddrV6 {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "sockaddr_setters", since = "1.9.0")]
|
||||
#[rustc_const_unstable(feature = "const_sockaddr_setters", issue = "131714")]
|
||||
#[rustc_const_stable(feature = "const_sockaddr_setters", since = "CURRENT_RUSTC_VERSION")]
|
||||
pub const fn set_ip(&mut self, new_ip: Ipv6Addr) {
|
||||
self.ip = new_ip;
|
||||
}
|
||||
@ -484,7 +484,7 @@ impl SocketAddrV6 {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "sockaddr_setters", since = "1.9.0")]
|
||||
#[rustc_const_unstable(feature = "const_sockaddr_setters", issue = "131714")]
|
||||
#[rustc_const_stable(feature = "const_sockaddr_setters", since = "CURRENT_RUSTC_VERSION")]
|
||||
pub const fn set_port(&mut self, new_port: u16) {
|
||||
self.port = new_port;
|
||||
}
|
||||
@ -532,7 +532,7 @@ impl SocketAddrV6 {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "sockaddr_setters", since = "1.9.0")]
|
||||
#[rustc_const_unstable(feature = "const_sockaddr_setters", issue = "131714")]
|
||||
#[rustc_const_stable(feature = "const_sockaddr_setters", since = "CURRENT_RUSTC_VERSION")]
|
||||
pub const fn set_flowinfo(&mut self, new_flowinfo: u32) {
|
||||
self.flowinfo = new_flowinfo;
|
||||
}
|
||||
@ -575,7 +575,7 @@ impl SocketAddrV6 {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "sockaddr_setters", since = "1.9.0")]
|
||||
#[rustc_const_unstable(feature = "const_sockaddr_setters", issue = "131714")]
|
||||
#[rustc_const_stable(feature = "const_sockaddr_setters", since = "CURRENT_RUSTC_VERSION")]
|
||||
pub const fn set_scope_id(&mut self, new_scope_id: u32) {
|
||||
self.scope_id = new_scope_id;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user