about summary refs log tree commit diff
path: root/library
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2025-05-13 21:22:45 +0200
committerSamuel Tardieu <sam@rfc1149.net>2025-05-14 09:34:25 +0200
commit7b1ba425e7b29e81b0d9d2e8354fc0164b134de3 (patch)
treeff126d576b03fd7741ed2a02ee7e7200408808c0 /library
parent414482f6a0d4e7290f614300581a0b55442552a3 (diff)
downloadrust-7b1ba425e7b29e81b0d9d2e8354fc0164b134de3.tar.gz
rust-7b1ba425e7b29e81b0d9d2e8354fc0164b134de3.zip
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.rs2
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 {