Move const tests for Poll to library\core

Part of #76268
This commit is contained in:
Christiaan Dirkx 2020-09-04 01:04:34 +02:00
parent 9412a898fa
commit ce1d5ed31a
3 changed files with 15 additions and 13 deletions

View File

@ -76,5 +76,6 @@
mod slice;
mod str;
mod str_lossy;
mod task;
mod time;
mod tuple;

View File

@ -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);
}

View File

@ -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);
}