diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-05-14 18:43:39 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-14 18:43:39 +0200 |
| commit | a1b5841bcc1c13e92ab030ead0e95e1d876accd5 (patch) | |
| tree | 15a4b5654ffce7132392f9cb5a4e73ad019aed88 /library | |
| parent | bbd2301a0026d6b8cb810e13872a413b5bcb1d52 (diff) | |
| parent | 7b1ba425e7b29e81b0d9d2e8354fc0164b134de3 (diff) | |
| download | rust-a1b5841bcc1c13e92ab030ead0e95e1d876accd5.tar.gz rust-a1b5841bcc1c13e92ab030ead0e95e1d876accd5.zip | |
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.
Diffstat (limited to 'library')
| -rw-r--r-- | library/core/src/net/ip_addr.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/library/core/src/net/ip_addr.rs b/library/core/src/net/ip_addr.rs index 2f027be6928..aaa68e8d7d1 100644 --- a/library/core/src/net/ip_addr.rs +++ b/library/core/src/net/ip_addr.rs @@ -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 { |
