about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/consts/std/net/ip.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/consts/std/net/ip.rs b/src/test/ui/consts/std/net/ip.rs
new file mode 100644
index 00000000000..6730946577d
--- /dev/null
+++ b/src/test/ui/consts/std/net/ip.rs
@@ -0,0 +1,13 @@
+// run-pass
+
+use std::net::{IpAddr, Ipv4Addr};
+
+fn main() {
+    const IP_ADDRESS : IpAddr = IpAddr::V4(Ipv4Addr::LOCALHOST);
+
+    const IS_IP_V4 : bool = IP_ADDRESS.is_ipv4();
+    assert!(IS_IP_V4);
+
+    const IS_IP_V6 : bool = IP_ADDRESS.is_ipv6();
+    assert!(!IS_IP_V6);
+}