Merge pull request #688 from RalfJung/rustup

rustup
This commit is contained in:
Ralf Jung 2019-04-12 23:13:30 +02:00 committed by GitHub
commit c758a79390
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -1 +1 @@
2226c09699a96520238e162777f44504f4a0a1a7
df25d79a33b0c82b716699a75a41bfdc6089850a

View file

@ -24,18 +24,22 @@ fn raw_waker_clone(_this: *const ()) -> RawWaker {
fn raw_waker_wake(_this: *const ()) {
panic!("unimplemented");
}
fn raw_waker_wake_by_ref(_this: *const ()) {
panic!("unimplemented");
}
fn raw_waker_drop(_this: *const ()) {}
static RAW_WAKER: RawWakerVTable = RawWakerVTable::new(
raw_waker_clone,
raw_waker_wake,
raw_waker_wake_by_ref,
raw_waker_drop,
);
fn main() {
let x = 5;
let mut fut = foo(&x, 7);
let waker = unsafe { Waker::new_unchecked(RawWaker::new(ptr::null(), &RAW_WAKER)) };
let waker = unsafe { Waker::from_raw(RawWaker::new(ptr::null(), &RAW_WAKER)) };
let mut context = Context::from_waker(&waker);
assert_eq!(unsafe { Pin::new_unchecked(&mut fut) }.poll(&mut context), Poll::Ready(31));
}