1
Fork 0

Make delegation methods of std::net::IpAddr unstable const

Make the following methods of `std::net::IpAddr` unstable const under the `const_ip` feature:
- `is_unspecified`
- `is_loopback`
- `is_global`
- `is_multicast`

Also adds a test for these methods in a const context.

Possible because these methods delegate to the inner `Ipv4Addr` or `Ipv6Addr`, which were made const, and the recent stabilization of const control flow.

Part of #76205
This commit is contained in:
Christiaan Dirkx 2020-09-07 17:43:48 +02:00 committed by Christiaan
parent a6008fac97
commit 947536fca0
3 changed files with 30 additions and 5 deletions

View file

@ -238,6 +238,7 @@
#![feature(const_cstr_unchecked)]
#![feature(const_fn_transmute)]
#![feature(const_fn)]
#![feature(const_ip)]
#![feature(const_ipv6)]
#![feature(const_raw_ptr_deref)]
#![feature(const_ipv4)]