diff options
| author | Christiaan Dirkx <christiaan@dirkx.email> | 2020-09-04 01:04:34 +0200 |
|---|---|---|
| committer | Christiaan Dirkx <christiaan@dirkx.email> | 2020-09-04 01:04:34 +0200 |
| commit | ce1d5ed31aff33bbbb116fffabd6107491c464bc (patch) | |
| tree | 5ae56f64874bf05521ad2aff4d7f3f94de1b4212 | |
| parent | 9412a898fa4ed5065a363bd40ad9401469ed3d54 (diff) | |
| download | rust-ce1d5ed31aff33bbbb116fffabd6107491c464bc.tar.gz rust-ce1d5ed31aff33bbbb116fffabd6107491c464bc.zip | |
Move const tests for `Poll` to `library\core`
Part of #76268
| -rw-r--r-- | library/core/tests/lib.rs | 1 | ||||
| -rw-r--r-- | library/core/tests/task.rs | 14 | ||||
| -rw-r--r-- | src/test/ui/consts/std/poll.rs | 13 |
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); -} |
