From 3f552fea269850a16b3e5f9743f0ab783c668787 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 7 Apr 2019 20:05:57 +0200 Subject: [PATCH 1/4] test calling Box --- tests/run-pass/closures.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/run-pass/closures.rs b/tests/run-pass/closures.rs index 9b379051eb..141e6cd6d0 100644 --- a/tests/run-pass/closures.rs +++ b/tests/run-pass/closures.rs @@ -40,9 +40,14 @@ fn fn_once_closure_with_multiple_args() -> i64 { } } +fn boxed(f: Box i32>) -> i32 { + f() +} + fn main() { assert_eq!(simple(), 12); assert_eq!(crazy_closure(), (84, 10, 10)); assert_eq!(closure_arg_adjustment_problem(), 3); assert_eq!(fn_once_closure_with_multiple_args(), 6); + assert_eq!(boxed(Box::new({let x = 13; move || x})), 13); } From 06af617b92680b791875a2b0d88700ac9253b8f0 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 8 Apr 2019 13:40:11 +0200 Subject: [PATCH 2/4] fix dumping uninitialized locals --- src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index be58c6a6a4..728d32f969 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -264,9 +264,7 @@ pub fn eval_main<'a, 'tcx: 'a>( trace!("Frame {}", i); trace!(" return: {:#?}", frame.return_place); for (i, local) in frame.locals.iter().enumerate() { - if let Ok(local) = local.access() { - trace!(" local {}: {:?}", i, local); - } + trace!(" local {}: {:?}", i, local.value); } } } From 83d199eb86c107087ad40fab1c98ceb1d799b2de Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 10 Apr 2019 17:20:54 +0200 Subject: [PATCH 3/4] fix async-fn test --- tests/run-pass/async-fn.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/run-pass/async-fn.rs b/tests/run-pass/async-fn.rs index 79fcb59011..7af2304cb4 100644 --- a/tests/run-pass/async-fn.rs +++ b/tests/run-pass/async-fn.rs @@ -1,4 +1,3 @@ -// ignore-test FIXME ignored to let https://github.com/rust-lang/rust/pull/59119 land #![feature( async_await, await_macro, @@ -6,7 +5,7 @@ )] use std::{future::Future, pin::Pin, task::Poll, ptr}; -use std::task::{Waker, RawWaker, RawWakerVTable}; +use std::task::{Waker, RawWaker, RawWakerVTable, Context}; // See if we can run a basic `async fn` pub async fn foo(x: &u32, y: u32) -> u32 { @@ -27,15 +26,16 @@ fn raw_waker_wake(_this: *const ()) { } fn raw_waker_drop(_this: *const ()) {} -static RAW_WAKER: RawWakerVTable = RawWakerVTable { - clone: raw_waker_clone, - wake: raw_waker_wake, - drop: raw_waker_drop, -}; +static RAW_WAKER: RawWakerVTable = RawWakerVTable::new( + raw_waker_clone, + raw_waker_wake, + 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)) }; - assert_eq!(unsafe { Pin::new_unchecked(&mut fut) }.poll(&waker), Poll::Ready(31)); + let mut context = Context::from_waker(&waker); + assert_eq!(unsafe { Pin::new_unchecked(&mut fut) }.poll(&mut context), Poll::Ready(31)); } From 8235f5694cccdb131f1a26f94eb7a9bc8f9e3117 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 11 Apr 2019 22:09:27 +0200 Subject: [PATCH 4/4] bump Rust version --- rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-version b/rust-version index a2b3daad97..69a46de1d4 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -f717b58dd70829f105960a071c7992b440720482 +3de0106789468b211bcc3a25c09c0cf07119186d