about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2020-12-01 10:50:15 +0000
committerGitHub <noreply@github.com>2020-12-01 10:50:15 +0000
commit2404409c6c1db267fbf27c92b8ee23fafd97a377 (patch)
tree8f6e02a81c52e2d88c129ffb9bb7c8cb4af39a76
parentbf3f4c85c7abca92aae4aaf69fac2b4f6907ee7b (diff)
parentd4ee2f6dc5ba9d9e978ac052079ae3f6a5d4551b (diff)
Rollup merge of #79444 - sasurau4:test/move-const-ip, r=matklad
Move const ip in ui test to unit test

Helps with #76268

r? ``@matklad``
-rw-r--r--library/std/src/net/ip/tests.rs6
-rw-r--r--src/test/ui/consts/std/net/ip.rs13
2 files changed, 6 insertions, 13 deletions
diff --git a/library/std/src/net/ip/tests.rs b/library/std/src/net/ip/tests.rs
index d9fbdd1b5e7..44fb3adf070 100644
--- a/library/std/src/net/ip/tests.rs
+++ b/library/std/src/net/ip/tests.rs
@@ -936,4 +936,10 @@ fn ip_const() {
 
     const IS_MULTICAST: bool = IP_ADDRESS.is_multicast();
     assert!(!IS_MULTICAST);
+
+    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);
 }
diff --git a/src/test/ui/consts/std/net/ip.rs b/src/test/ui/consts/std/net/ip.rs
deleted file mode 100644
index 6730946577d..00000000000
--- a/src/test/ui/consts/std/net/ip.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-// 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);
-}