about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristiaan Dirkx <christiaan@dirkx.email>2020-09-04 01:04:34 +0200
committerChristiaan Dirkx <christiaan@dirkx.email>2020-09-04 01:04:34 +0200
commitce1d5ed31aff33bbbb116fffabd6107491c464bc (patch)
tree5ae56f64874bf05521ad2aff4d7f3f94de1b4212
parent9412a898fa4ed5065a363bd40ad9401469ed3d54 (diff)
downloadrust-ce1d5ed31aff33bbbb116fffabd6107491c464bc.tar.gz
rust-ce1d5ed31aff33bbbb116fffabd6107491c464bc.zip
Move const tests for `Poll` to `library\core`
Part of #76268
-rw-r--r--library/core/tests/lib.rs1
-rw-r--r--library/core/tests/task.rs14
-rw-r--r--src/test/ui/consts/std/poll.rs13
3 files changed, 15 insertions, 13 deletions
diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs
index 81e621318e1..2c20259fc58 100644
--- a/library/core/tests/lib.rs
+++ b/library/core/tests/lib.rs
@@ -76,5 +76,6 @@ mod result;
 mod slice;
 mod str;
 mod str_lossy;
+mod task;
 mod time;
 mod tuple;
diff --git a/library/core/tests/task.rs b/library/core/tests/task.rs
new file mode 100644
index 00000000000..d71fef9e5c8
--- /dev/null
+++ b/library/core/tests/task.rs
@@ -0,0 +1,14 @@
+use core::task::Poll;
+
+#[test]
+fn poll_const() {
+    // test that the methods of `Poll` are usable in a const context
+
+    const POLL: Poll<usize> = Poll::Pending;
+
+    const IS_READY: bool = POLL.is_ready();
+    assert!(!IS_READY);
+
+    const IS_PENDING: bool = POLL.is_pending();
+    assert!(IS_PENDING);
+}
diff --git a/src/test/ui/consts/std/poll.rs b/src/test/ui/consts/std/poll.rs
deleted file mode 100644
index 28f2ace6715..00000000000
--- a/src/test/ui/consts/std/poll.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-// run-pass
-
-use std::task::Poll;
-
-fn main() {
-    const POLL : Poll<usize> = Poll::Pending;
-
-    const IS_READY : bool = POLL.is_ready();
-    assert!(!IS_READY);
-
-    const IS_PENDING : bool = POLL.is_pending();
-    assert!(IS_PENDING);
-}