about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2021-04-04 00:19:30 +0900
committerGitHub <noreply@github.com>2021-04-04 00:19:30 +0900
commit3b40d2c1f3ef12c602c804282ff262fd694ffbba (patch)
treec0a2eb77864e572b8859de90199856d80c578750 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent640ce99bfe70375a24c6775a937d6a258b40398b (diff)
parent5b84b9a8d8518e3db0e9f7995a54297a33c59b5c (diff)
downloadrust-3b40d2c1f3ef12c602c804282ff262fd694ffbba.tar.gz
rust-3b40d2c1f3ef12c602c804282ff262fd694ffbba.zip
Rollup merge of #82487 - CDirkx:const-socketaddr, r=m-ou-se
Constify methods of `std::net::SocketAddr`, `SocketAddrV4` and `SocketAddrV6`

The following methods are made unstable const under the `const_socketaddr` feature (https://github.com/rust-lang/rust/issues/82485):

```rust
// std::net

impl SocketAddr {
    pub const fn ip(&self) -> IpAddr;
    pub const fn port(&self) -> u16;
    pub const fn is_ipv4(&self) -> bool;
    pub const fn is_ipv6(&self) -> bool;
}

impl SocketAddrV4 {
    pub const fn ip(&self) -> IpAddr;
    pub const fn port(&self) -> u16;
}

impl SocketAddrV6 {
    pub const fn ip(&self) -> IpAddr;
    pub const fn port(&self) -> u16;
    pub const fn flowinfo(&self) -> u32;
    pub const fn scope_id(&self) -> u32;
}
```

Note: `SocketAddrV4::ip` and `SocketAddrV6::ip` use pointer casting and depend on the unstable feature `const_raw_ptr_deref`
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions