Rollup merge of #140976 - samueltardieu:diag-ipaddr-v4v6, r=Urgau
Add `Ipv4Addr` and `Ipv6Addr` diagnostic items They will be used in Clippy to detect runtime parsing of known-valid IP addresses.
This commit is contained in:
commit
a1b5841bcc
2 changed files with 4 additions and 0 deletions
|
|
@ -280,6 +280,8 @@ symbols! {
|
|||
IoSeek,
|
||||
IoWrite,
|
||||
IpAddr,
|
||||
Ipv4Addr,
|
||||
Ipv6Addr,
|
||||
IrTyKind,
|
||||
Is,
|
||||
Item,
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ pub enum IpAddr {
|
|||
/// assert!("0000000.0.0.0".parse::<Ipv4Addr>().is_err()); // first octet is a zero in octal
|
||||
/// assert!("0xcb.0x0.0x71.0x00".parse::<Ipv4Addr>().is_err()); // all octets are in hex
|
||||
/// ```
|
||||
#[rustc_diagnostic_item = "Ipv4Addr"]
|
||||
#[derive(Copy, Clone, PartialEq, Eq)]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct Ipv4Addr {
|
||||
|
|
@ -160,6 +161,7 @@ impl Hash for Ipv4Addr {
|
|||
/// assert_eq!("::1".parse(), Ok(localhost));
|
||||
/// assert_eq!(localhost.is_loopback(), true);
|
||||
/// ```
|
||||
#[rustc_diagnostic_item = "Ipv6Addr"]
|
||||
#[derive(Copy, Clone, PartialEq, Eq)]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct Ipv6Addr {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue