std::net: add warning in Ipv4addr::is_reserved() documentation

See @the8472 comment's on Github:
https://github.com/rust-lang/rust/pull/60145#issuecomment-485424229

> I don't think is_reserved including ranges marked for future use is
> a good idea since those future uses may be realized at at some point
> and then old software with is_reserved filters may have false
> positives. This is not a hypothetical concern, such issues have been
> encountered before when IANA assigned previously reserved /8 address
> blocks.
This commit is contained in:
Corentin Henry 2019-04-23 10:40:15 +02:00
parent 634dcd00b4
commit fe718ef07f

View file

@ -677,6 +677,13 @@ impl Ipv4Addr {
/// [IETF RFC 1112]: https://tools.ietf.org/html/rfc1112
/// [`true`]: ../../std/primitive.bool.html
///
/// # Warning
///
/// As IANA assigns new addresses, this method will be
/// updated. This may result in non-reserved addresses being
/// treated as reserved in code that relies on an outdated version
/// of this method.
///
/// # Examples
///
/// ```