mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
parent
9412a898fa
commit
ce1d5ed31a
@ -76,5 +76,6 @@ mod result;
|
||||
mod slice;
|
||||
mod str;
|
||||
mod str_lossy;
|
||||
mod task;
|
||||
mod time;
|
||||
mod tuple;
|
||||
|
14
library/core/tests/task.rs
Normal file
14
library/core/tests/task.rs
Normal 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);
|
||||
}
|
@ -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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user