Skip to content

Commit ce1d5ed

Browse files
committed
Move const tests for Poll to library\core
Part of rust-lang#76268
1 parent 9412a89 commit ce1d5ed

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

library/core/tests/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,6 @@ mod result;
7676
mod slice;
7777
mod str;
7878
mod str_lossy;
79+
mod task;
7980
mod time;
8081
mod tuple;

library/core/tests/task.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use core::task::Poll;
2+
3+
#[test]
4+
fn poll_const() {
5+
// test that the methods of `Poll` are usable in a const context
6+
7+
const POLL: Poll<usize> = Poll::Pending;
8+
9+
const IS_READY: bool = POLL.is_ready();
10+
assert!(!IS_READY);
11+
12+
const IS_PENDING: bool = POLL.is_pending();
13+
assert!(IS_PENDING);
14+
}

src/test/ui/consts/std/poll.rs

-13
This file was deleted.

0 commit comments

Comments
 (0)