From d39d2c834d19d5bc538a23575d709a91a36ec791 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Thu, 27 Jun 2019 04:07:54 +0900 Subject: [PATCH] Fix ui tests --- futures/testcrate/ui/move-captured-variable.stderr | 8 ++++++-- futures/testcrate/ui/nested.stderr | 12 +++--------- futures/testcrate/ui/update-all-references.sh | 3 ++- futures/testcrate/ui/update-references.sh | 2 +- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/futures/testcrate/ui/move-captured-variable.stderr b/futures/testcrate/ui/move-captured-variable.stderr index bacd96c626..956dba9012 100644 --- a/futures/testcrate/ui/move-captured-variable.stderr +++ b/futures/testcrate/ui/move-captured-variable.stderr @@ -1,4 +1,4 @@ -error[E0507]: cannot move out of captured variable in an `FnMut` closure +error[E0507]: cannot move out of `a`, a captured variable in an `FnMut` closure --> $DIR/move-captured-variable.rs:10:9 | 8 | let a = String::new(); @@ -6,8 +6,12 @@ error[E0507]: cannot move out of captured variable in an `FnMut` closure 9 | foo(|| { 10 | / async_stream_block! { 11 | | yield a + | | - + | | | + | | move occurs because `a` has type `std::string::String`, which does not implement the `Copy` trait + | | move occurs due to use in generator 12 | | }; - | |__________^ cannot move out of captured variable in an `FnMut` closure + | |__________^ move out of `a` occurs here error: aborting due to previous error diff --git a/futures/testcrate/ui/nested.stderr b/futures/testcrate/ui/nested.stderr index abe9207df0..444c03e5d1 100644 --- a/futures/testcrate/ui/nested.stderr +++ b/futures/testcrate/ui/nested.stderr @@ -1,14 +1,8 @@ error[E0727]: `async` generators are not yet supported - --> $DIR/nested.rs:7:19 + --> $DIR/nested.rs:10:13 | -7 | let _ = async { - | ___________________^ -8 | | #[for_await] -9 | | for i in stream::iter(vec![1, 2]) { -10 | | yield i * i; -11 | | } -12 | | }; - | |_____^ +10 | yield i * i; + | ^^^^^^^^^^^ error: aborting due to previous error diff --git a/futures/testcrate/ui/update-all-references.sh b/futures/testcrate/ui/update-all-references.sh index 13545510c0..207a562c7e 100755 --- a/futures/testcrate/ui/update-all-references.sh +++ b/futures/testcrate/ui/update-all-references.sh @@ -18,6 +18,7 @@ # # See all `update-references.sh`, if you just want to update a single test. -MY_DIR="$(dirname "${BASH_SOURCE[0]}")" +MY_DIR=$(dirname $0) cd $MY_DIR find . -name '*.rs' | xargs ./update-references.sh +cd - diff --git a/futures/testcrate/ui/update-references.sh b/futures/testcrate/ui/update-references.sh index 67aa4f857e..fa83607914 100755 --- a/futures/testcrate/ui/update-references.sh +++ b/futures/testcrate/ui/update-references.sh @@ -19,7 +19,7 @@ # If you find yourself manually editing a foo.stderr file, you're # doing it wrong. -MYDIR="$(dirname "${BASH_SOURCE[0]}")" +MYDIR=$(dirname $0) BUILD_DIR="../target/tests/ui"