Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wg-async-await] Drop `async fn` arguments in async block #59823

Merged
merged 10 commits into from Apr 23, 2019

Conversation

Projects
None yet
5 participants
@davidtwco
Copy link
Member

commented Apr 9, 2019

Fixes #54716.

This PR modifies the HIR lowering (and some other places to make this work) so that unused arguments to a async function are always dropped inside the async move block and not at the end of the function body.

async fn foo(<pattern>: <type>) {
  async move {
  }
} // <-- dropped as you "exit" the fn

// ...becomes...
fn foo(__arg0: <ty>) {
  async move {
    let <pattern>: <ty> = __arg0;
  } // <-- dropped as you "exit" the async block
}

However, the exact ordering of drops is not the same as a regular function, as visible in this playground example - I believe this to be an unrelated issue. There is a Zulip topic for this.

r? @cramertj
cc @nikomatsakis

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Apr 9, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:050adab0:start=1554838355770233319,finish=1554838358021494345,duration=2251261026
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[01:05:32] .................................................................................................... 2600/5530
[01:05:36] .................................................................................................... 2700/5530
[01:05:40] .................................................................................................... 2800/5530
[01:05:44] .................................................................................................... 2900/5530
[01:05:49] .......................................................................F..F......................... 3000/5530
[01:05:52] ...................F.F.............................................................................. 3100/5530
[01:06:00] .................................................................................................... 3300/5530
[01:06:03] ..............................i..................................................................... 3400/5530
[01:06:07] .................................................................................................... 3500/5530
[01:06:10] ....ii...i..ii...................................................................................... 3600/5530
---
[01:07:25] failures:
[01:07:25] 
[01:07:25] ---- [ui] ui/issues/issue-54974.rs stdout ----
[01:07:25] 
[01:07:25] error: test compilation failed although it shouldn't!
[01:07:25] status: exit code: 1
[01:07:25] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-54974.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-54974/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2018" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-54974/auxiliary" "-A" "unused"
[01:07:25] ------------------------------------------
[01:07:25] 
[01:07:25] ------------------------------------------
[01:07:25] stderr:
[01:07:25] stderr:
[01:07:25] ------------------------------------------
[01:07:25] {"message":"type annotations needed","code":{"code":"E0282","explanation":"\nThis error indicates that type inference did not result in one unique possible\ntype, and extra information is required. In most cases this can be provided\nby adding a type annotation. Sometimes you need to specify a generic type\nparameter manually.\n\nA common example is the `collect` method on `Iterator`. It has a generic type\nparameter with a `FromIterator` bound, which for a `char` iterator is\nimplemented by `Vec` and `String` among others. Consider the following snippet\nthat reverses the characters of a string:\n\n```compile_fail,E0282\nlet x = \"hello\".chars().rev().collect();\n```\n\nIn this case, the compiler cannot infer what the type of `x` should be:\n`Vec<char>` and `String` are both suitable candidates. To specify which type to\nuse, you can use a type annotation on `x`:\n\n```\nlet x: Vec<char> = \"hello\".chars().rev().collect();\n```\n\nIt is not necessary to annotate the full type. Once the ambiguity is resolved,\nthe compiler can infer the rest:\n\n```\nlet x: Vec<_> = \"hello\".chars().rev().collect();\n```\n\nAnother way to provide the compiler with enough information, is to specify the\ngeneric type parameter:\n\n```\nlet x = \"hello\".chars().rev().collect::<Vec<char>>();\n```\n\nAgain, you need not specify the full type if the compiler can infer it:\n\n```\nlet x = \"hello\".chars().rev().collect::<Vec<_>>();\n```\n\nApart from a method or function with a generic type parameter, this error can\noccur when a type parameter of a struct or trait cannot be inferred. In that\ncase it is not always possible to use a type annotation, because all candidates\nhave the same return type. For instance:\n\n```compile_fail,E0282\nstruct Foo<T> {\n    num: T,\n}\n\nimpl<T> Foo<T> {\n    fn bar() -> i32 {\n        0\n    }\n\n    fn baz() {\n        let number = Foo::bar();\n    }\n}\n```\n\nThis will fail because the compiler does not know which instance of `Foo` to\ncall `bar` on. Change `Foo::bar()` to `Foo::<T>::bar()` to resolve the error.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-54974.rs","byte_start":195,"byte_end":198,"line_start":12,"line_end":12,"column_start":18,"column_end":21,"is_primary":true,"text":[{"text":"async fn my_task(obj: Arc<SomeTrait>) {","highlight_start":18,"highlight_end":21}],"label":"cannot infer type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0282]: type annotations needed\n  --> /checkout/src/test/ui/issues/issue-54974.rs:12:18\n   |\nLL | async fn my_task(obj: Arc<SomeTrait>) {\n   |                  ^^^ cannot infer type\n\n"}
[01:07:25] {"message":"For more information about this error, try `rustc --explain E0282`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0282`.\n"}
[01:07:25] 
[01:07:25] ------------------------------------------
[01:07:25] 
[01:07:25] 
[01:07:25] thread '[ui] ui/issues/issue-54974.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3425:9
[01:07:25] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:07:25] 
[01:07:25] ---- [ui] ui/issues/issue-55324.rs stdout ----
[01:07:25] 
[01:07:25] error: test compilation failed although it shouldn't!
[01:07:25] status: exit code: 1
[01:07:25] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-55324.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-55324/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2018" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-55324/auxiliary" "-A" "unused"
[01:07:25] ------------------------------------------
[01:07:25] 
[01:07:25] ------------------------------------------
[01:07:25] stderr:
[01:07:25] stderr:
[01:07:25] ------------------------------------------
[01:07:25] {"message":"type annotations needed","code":{"code":"E0282","explanation":"\nThis error indicates that type inference did not result in one unique possible\ntype, and extra information is required. In most cases this can be provided\nby adding a type annotation. Sometimes you need to specify a generic type\nparameter manually.\n\nA common example is the `collect` method on `Iterator`. It has a generic type\nparameter with a `FromIterator` bound, which for a `char` iterator is\nimplemented by `Vec` and `String` among others. Consider the following snippet\nthat reverses the characters of a string:\n\n```compile_fail,E0282\nlet x = \"hello\".chars().rev().collect();\n```\n\nIn this case, the compiler cannot infer what the type of `x` should be:\n`Vec<char>` and `String` are both suitable candidates. To specify which type to\nuse, you can use a type annotation on `x`:\n\n```\nlet x: Vec<char> = \"hello\".chars().rev().collect();\n```\n\nIt is not necessary to annotate the full type. Once the ambiguity is resolved,\nthe compiler can infer the rest:\n\n```\nlet x: Vec<_> = \"hello\".chars().rev().collect();\n```\n\nAnother way to provide the compiler with enough information, is to specify the\ngeneric type parameter:\n\n```\nlet x = \"hello\".chars().rev().collect::<Vec<char>>();\n```\n\nAgain, you need not specify the full type if the compiler can infer it:\n\n```\nlet x = \"hello\".chars().rev().collect::<Vec<_>>();\n```\n\nApart from a method or function with a generic type parameter, this error can\noccur when a type parameter of a struct or trait cannot be inferred. In that\ncase it is not always possible to use a type annotation, because all candidates\nhave the same return type. For instance:\n\n```compile_fail,E0282\nstruct Foo<T> {\n    num: T,\n}\n\nimpl<T> Foo<T> {\n    fn bar() -> i32 {\n        0\n    }\n\n    fn baz() {\n        let number = Foo::bar();\n    }\n}\n```\n\nThis will fail because the compiler does not know which instance of `Foo` to\ncall `bar` on. Change `Foo::bar()` to `Foo::<T>::bar()` to resolve the error.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-55324.rs","byte_start":166,"byte_end":167,"line_start":9,"line_end":9,"column_start":39,"column_end":40,"is_primary":true,"text":[{"text":"async fn foo<F: Future<Output = i32>>(x: &i32, future: F) -> i32 {","highlight_start":39,"highlight_end":40}],"label":"cannot infer type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0282]: type annotations needed\n  --> /checkout/src/test/ui/issues/issue-55324.rs:9:39\n   |\nLL | async fn foo<F: Future<Output = i32>>(x: &i32, future: F) -> i32 {\n   |                                       ^ cannot infer type\n\n"}
[01:07:25] {"message":"For more information about this error, try `rustc --explain E0282`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0282`.\n"}
[01:07:25] 
[01:07:25] ------------------------------------------
[01:07:25] 
[01:07:25] 
[01:07:25] thread '[ui] ui/issues/issue-55324.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3425:9
[01:07:25] 
[01:07:25] ---- [ui] ui/issues/issue-58885.rs stdout ----
[01:07:25] 
[01:07:25] error: test compilation failed although it shouldn't!
[01:07:25] status: exit code: 1
[01:07:25] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-58885.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-58885/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2018" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-58885/auxiliary" "-A" "unused"
[01:07:25] ------------------------------------------
[01:07:25] 
[01:07:25] ------------------------------------------
[01:07:25] stderr:
[01:07:25] stderr:
[01:07:25] ------------------------------------------
[01:07:25] {"message":"type annotations needed","code":{"code":"E0282","explanation":"\nThis error indicates that type inference did not result in one unique possible\ntype, and extra information is required. In most cases this can be provided\nby adding a type annotation. Sometimes you need to specify a generic type\nparameter manually.\n\nA common example is the `collect` method on `Iterator`. It has a generic type\nparameter with a `FromIterator` bound, which for a `char` iterator is\nimplemented by `Vec` and `String` among others. Consider the following snippet\nthat reverses the characters of a string:\n\n```compile_fail,E0282\nlet x = \"hello\".chars().rev().collect();\n```\n\nIn this case, the compiler cannot infer what the type of `x` should be:\n`Vec<char>` and `String` are both suitable candidates. To specify which type to\nuse, you can use a type annotation on `x`:\n\n```\nlet x: Vec<char> = \"hello\".chars().rev().collect();\n```\n\nIt is not necessary to annotate the full type. Once the ambiguity is resolved,\nthe compiler can infer the rest:\n\n```\nlet x: Vec<_> = \"hello\".chars().rev().collect();\n```\n\nAnother way to provide the compiler with enough information, is to specify the\ngeneric type parameter:\n\n```\nlet x = \"hello\".chars().rev().collect::<Vec<char>>();\n```\n\nAgain, you need not specify the full type if the compiler can infer it:\n\n```\nlet x = \"hello\".chars().rev().collect::<Vec<_>>();\n```\n\nApart from a method or function with a generic type parameter, this error can\noccur when a type parameter of a struct or trait cannot be inferred. In that\ncase it is not always possible to use a type annotation, because all candidates\nhave the same return type. For instance:\n\n```compile_fail,E0282\nstruct Foo<T> {\n    num: T,\n}\n\nimpl<T> Foo<T> {\n    fn bar() -> i32 {\n        0\n    }\n\n    fn baz() {\n        let number = Foo::bar();\n    }\n}\n```\n\nThis will fail because the compiler does not know which instance of `Foo` to\ncall `bar` on. Change `Foo::bar()` to `Foo::<T>::bar()` to resolve the error.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-58885.rs","byte_start":171,"byte_end":179,"line_start":14,"line_end":14,"column_start":9,"column_end":17,"is_primary":true,"text":[{"text":"        &'a self, foo: &'a dyn Foo","highlight_start":9,"highlight_end":17}],"label":"cannot infer type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0282]: type annotations needed\n  --> /checkout/src/test/ui/issues/issue-58885.rs:14:9\n   |\nLL |         &'a self, foo: &'a dyn Foo\n   |         ^^^^^^^^ cannot infer type\n\n"}
[01:07:25] {"message":"For more information about this error, try `rustc --explain E0282`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0282`.\n"}
[01:07:25] 
[01:07:25] ------------------------------------------
[01:07:25] 
[01:07:25] 
[01:07:25] thread '[ui] ui/issues/issue-58885.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3425:9
[01:07:25] 
[01:07:25] ---- [ui] ui/issues/issue-59001.rs stdout ----
[01:07:25] 
[01:07:25] error: test compilation failed although it shouldn't!
[01:07:25] status: exit code: 1
[01:07:25] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-59001.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-59001/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2018" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-59001/auxiliary" "-A" "unused"
[01:07:25] ------------------------------------------
[01:07:25] 
[01:07:25] ------------------------------------------
[01:07:25] stderr:
[01:07:25] stderr:
[01:07:25] ------------------------------------------
[01:07:25] {"message":"type annotations needed","code":{"code":"E0282","explanation":"\nThis error indicates that type inference did not result in one unique possible\ntype, and extra information is required. In most cases this can be provided\nby adding a type annotation. Sometimes you need to specify a generic type\nparameter manually.\n\nA common example is the `collect` method on `Iterator`. It has a generic type\nparameter with a `FromIterator` bound, which for a `char` iterator is\nimplemented by `Vec` and `String` among others. Consider the following snippet\nthat reverses the characters of a string:\n\n```compile_fail,E0282\nlet x = \"hello\".chars().rev().collect();\n```\n\nIn this case, the compiler cannot infer what the type of `x` should be:\n`Vec<char>` and `String` are both suitable candidates. To specify which type to\nuse, you can use a type annotation on `x`:\n\n```\nlet x: Vec<char> = \"hello\".chars().rev().collect();\n```\n\nIt is not necessary to annotate the full type. Once the ambiguity is resolved,\nthe compiler can infer the rest:\n\n```\nlet x: Vec<_> = \"hello\".chars().rev().collect();\n```\n\nAnother way to provide the compiler with enough information, is to specify the\ngeneric type parameter:\n\n```\nlet x = \"hello\".chars().rev().collect::<Vec<char>>();\n```\n\nAgain, you need not specify the full type if the compiler can infer it:\n\n```\nlet x = \"hello\".chars().rev().collect::<Vec<_>>();\n```\n\nApart from a method or function with a generic type parameter, this error can\noccur when a type parameter of a struct or trait cannot be inferred. In that\ncase it is not always possible to use a type annotation, because all candidates\nhave the same return type. For instance:\n\n```compile_fail,E0282\nstruct Foo<T> {\n    num: T,\n}\n\nimpl<T> Foo<T> {\n    fn bar() -> i32 {\n        0\n    }\n\n    fn baz() {\n        let number = Foo::bar();\n    }\n}\n```\n\nThis will fail because the compiler does not know which instance of `Foo` to\ncall `bar` on. Change `Foo::bar()` to `Foo::<T>::bar()` to resolve the error.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-59001.rs","byte_start":153,"byte_end":165,"line_start":9,"line_end":9,"column_start":26,"column_end":38,"is_primary":true,"text":[{"text":"async fn enter<'a, F, R>(mut callback: F)","highlight_start":26,"highlight_end":38}],"label":"cannot infer type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0282]: type annotations needed\n  --> /checkout/src/test/ui/issues/issue-59001.rs:9:26\n   |\nLL | async fn enter<'a, F, R>(mut callback: F)\n   |                          ^^^^^^^^^^^^ cannot infer type\n\n"}
[01:07:25] {"message":"For more information about this error, try `rustc --explain E0282`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0282`.\n"}
[01:07:25] 
[01:07:25] ------------------------------------------
[01:07:25] 
---
[01:07:25] 
[01:07:25] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:516:22
[01:07:25] 
[01:07:25] 
[01:07:25] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:07:25] 
[01:07:25] 
[01:07:25] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:07:25] Build completed unsuccessfully in 0:04:25
[01:07:25] Build completed unsuccessfully in 0:04:25
[01:07:25] make: *** [check] Error 1
[01:07:25] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:09558c42
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Tue Apr  9 20:40:14 UTC 2019
---
travis_time:end:0fc3eff1:start=1554842416043625610,finish=1554842416050980098,duration=7354488
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:35a85878
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:03016640
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@davidtwco davidtwco force-pushed the davidtwco:issue-54716 branch from 6307521 to 414e269 Apr 21, 2019

@davidtwco

This comment has been minimized.

Copy link
Member Author

commented Apr 21, 2019

I believe I've resolved the test failures with this PR.

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Apr 21, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:15191826:start=1555808958141650945,finish=1555808960299598101,duration=2157947156
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
Check compiletest suite=mir-opt mode=mir-opt (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:14:20] 
[01:14:20] running 42 tests
[01:14:39] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:517:22
[01:14:39] .............FF...........................
[01:14:39] 
[01:14:39] ---- [mir-opt] mir-opt/inline-closure.rs stdout ----
[01:14:39] ---- [mir-opt] mir-opt/inline-closure.rs stdout ----
[01:14:39] thread '[mir-opt] mir-opt/inline-closure.rs' panicked at 'Did not find expected line, error: ran out of mir dump to match against
[01:14:39] Expected Line: "    _3 = [closure@HirId { owner: DefIndex(0:4), local_id: 13 }];"
[01:14:39] Test Name: rustc.foo.Inline.after.mir
[01:14:39] ... (elided)
[01:14:39] ... (elided)
[01:14:39] bb0: {
[01:14:39] ... (elided)
[01:14:39] ... (elided)
[01:14:39]     _3 = [closure@HirId { owner: DefIndex(0:4), local_id: 13 }];
[01:14:39] ... (elided)
[01:14:39]     _4 = &_3;
[01:14:39] ... (elided)
[01:14:39]     _6 = _2;
[01:14:39] ... (elided)
[01:14:39]     _7 = _2;
[01:14:39]     _5 = (move _6, move _7);
[01:14:39]     _8 = move (_5.0: i32);
[01:14:39]     _9 = move (_5.1: i32);
[01:14:39]     _0 = _8;
[01:14:39] ... (elided)
[01:14:39]     return;
[01:14:39] }
[01:14:39] ... (elided)
[01:14:39] Actual:
[01:14:39] fn  foo(_1: T, _2: i32) -> i32 {
[01:14:39]     let mut _0: i32;
[01:14:39]     scope 1 {
[01:14:39]         scope 3 {
[01:14:39]     }
[01:14:39]     scope 2 {
[01:14:39]     scope 2 {
[01:14:39]         let _3: [closure@HirId { owner: DefIndex(0:4), local_id: 15 }];
[01:14:39]     }
[01:14:39]     let mut _4: &[closure@HirId { owner: DefIndex(0:4), local_id: 15 }];
[01:14:39]     let mut _5: (i32, i32);
[01:14:39]     let mut _6: i32;
[01:14:39]     let mut _7: i32;
[01:14:39]     let mut _8: i32;
[01:14:39]     let mut _9: i32;
[01:14:39]     bb0: {
[01:14:39]         StorageLive(_3);
[01:14:39]         _3 = [closure@HirId { owner: DefIndex(0:4), local_id: 15 }];
[01:14:39]         StorageLive(_4);
[01:14:39]         _4 = &_3;
[01:14:39]         StorageLive(_5);
[01:14:39]         StorageLive(_6);
[01:14:39]         _6 = _2;
[01:14:39]         StorageLive(_7);
[01:14:39]         _7 = _2;
[01:14:39]         _5 = (move _6, move _7);
[01:14:39]         _8 = move (_5.0: i32);
[01:14:39]         _9 = move (_5.1: i32);
[01:14:39]         _0 = _8;
[01:14:39]         StorageDead(_5);
[01:14:39]         StorageDead(_7);
[01:14:39]         StorageDead(_6);
[01:14:39]         StorageDead(_4);
[01:14:39]         StorageDead(_3);
[01:14:39]         return;
[01:14:39] }', src/tools/compiletest/src/runtest.rs:3060:13
[01:14:39] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:14:39] 
[01:14:39] ---- [mir-opt] mir-opt/inline-closure-borrows-arg.rs stdout ----
[01:14:39] ---- [mir-opt] mir-opt/inline-closure-borrows-arg.rs stdout ----
[01:14:39] thread '[mir-opt] mir-opt/inline-closure-borrows-arg.rs' panicked at 'Did not find expected line, error: ran out of mir dump to match against
[01:14:39] Expected Line: "    _3 = [closure@HirId { owner: DefIndex(0:4), local_id: 29 }];"
[01:14:39] Test Name: rustc.foo.Inline.after.mir
[01:14:39] ... (elided)
[01:14:39] ... (elided)
[01:14:39] bb0: {
[01:14:39] ... (elided)
[01:14:39] ... (elided)
[01:14:39]     _3 = [closure@HirId { owner: DefIndex(0:4), local_id: 29 }];
[01:14:39] ... (elided)
[01:14:39]     _4 = &_3;
[01:14:39] ... (elided)
[01:14:39]     _6 = &(*_2);
[01:14:39] ... (elided)
[01:14:39]     _7 = &(*_2);
[01:14:39]     _5 = (move _6, move _7);
[01:14:39]     _8 = move (_5.0: &i32);
[01:14:39]     _9 = move (_5.1: &i32);
[01:14:39] ... (elided)
[01:14:39]     _0 = (*_8);
[01:14:39] ... (elided)
[01:14:39]     return;
[01:14:39] }
[01:14:39] ... (elided)
[01:14:39] Actual:
[01:14:39] fn  foo(_1: T, _2: &i32) -> i32 {
[01:14:39]     let mut _0: i32;
[01:14:39]     scope 1 {
[01:14:39]         scope 3 {
[01:14:39]     }
[01:14:39]     scope 2 {
[01:14:39]     scope 2 {
[01:14:39]         let _3: [closure@HirId { owner: DefIndex(0:4), local_id: 31 }];
[01:14:39]     scope 4 {
[01:14:39]     }
[01:14:39]     scope 5 {
[01:14:39]     }
[01:14:39]     }
[01:14:39]     let mut _4: &[closure@HirId { owner: DefIndex(0:4), local_id: 31 }];
[01:14:39]     let mut _5: (&i32, &i32);
[01:14:39]     let mut _6: &i32;
[01:14:39]     let mut _7: &i32;
[01:14:39]     let mut _8: &i32;
[01:14:39]     let mut _9: &i32;
[01:14:39]     bb0: {
[01:14:39]         StorageLive(_3);
[01:14:39]         _3 = [closure@HirId { owner: DefIndex(0:4), local_id: 31 }];
[01:14:39]         StorageLive(_4);
[01:14:39]         _4 = &_3;
[01:14:39]         StorageLive(_5);
[01:14:39]         StorageLive(_6);
[01:14:39]         _6 = &(*_2);
[01:14:39]         StorageLive(_7);
[01:14:39]         _7 = &(*_2);
[01:14:39]         _5 = (move _6, move _7);
[01:14:39]         _8 = move (_5.0: &i32);
[01:14:39]         _9 = move (_5.1: &i32);
[01:14:39]         _0 = (*_8);
[01:14:39]         StorageDead(_5);
[01:14:39]         StorageDead(_7);
[01:14:39]         StorageDead(_6);
[01:14:39]         StorageDead(_4);
[01:14:39]         StorageDead(_3);
[01:14:39]         return;
[01:14:39] }', src/tools/compiletest/src/runtest.rs:3060:13
[01:14:39] 
[01:14:39] 
[01:14:39] failures:
[01:14:39] failures:
[01:14:39]     [mir-opt] mir-opt/inline-closure-borrows-arg.rs
[01:14:39]     [mir-opt] mir-opt/inline-closure.rs
[01:14:39] 
[01:14:39] test result: FAILED. 40 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out
[01:14:39] 
[01:14:39] 
[01:14:39] 
[01:14:39] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/mir-opt" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "mir-opt" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:14:39] 
[01:14:39] 
[01:14:39] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:14:39] Build completed unsuccessfully in 0:11:40
[01:14:39] Build completed unsuccessfully in 0:11:40
[01:14:39] make: *** [check] Error 1
[01:14:39] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:1d6c7404
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sun Apr 21 02:24:09 UTC 2019

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors

This comment was marked as resolved.

Copy link
Contributor

commented Apr 21, 2019

☔️ The latest upstream changes (presumably #60088) made this pull request unmergeable. Please resolve the merge conflicts.

davidtwco added some commits Mar 7, 2019

Add test for drop order in async functions.
This tests that async functions drop parameters in the same order as
regular functions.
Introduce `LocalSource` into the AST.
This will be used to keep track of the origin of a local in the AST. In
particular, it will be used by `async fn` lowering for the locals in
`let <pat>: <ty> = __arg0;` statements.

@davidtwco davidtwco force-pushed the davidtwco:issue-54716 branch from 414e269 to ec85d21 Apr 21, 2019

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Apr 21, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:15ffd364:start=1555838795580904592,finish=1555838797724625833,duration=2143721241
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[01:17:56] 
[01:17:56] running 42 tests
[01:18:00] ERROR 2019-04-21T10:44:48Z: compiletest::runtest: None
[01:18:15] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:517:22
[01:18:15] ..............F...........................
[01:18:15] 
[01:18:15] ---- [mir-opt] mir-opt/inline-closure-borrows-arg.rs stdout ----
[01:18:15] ---- [mir-opt] mir-opt/inline-closure-borrows-arg.rs stdout ----
[01:18:15] thread '[mir-opt] mir-opt/inline-closure-borrows-arg.rs' panicked at 'Did not find expected line, error: Mismatch in lines
[01:18:15] Current block: None
[01:18:15] Actual Line: "        _8 = move (_5.0: &i32);"
[01:18:15] Expected Line: "    _9 = move (_5.0: &i32);"
[01:18:15] Test Name: rustc.foo.Inline.after.mir
[01:18:15] ... (elided)
[01:18:15] ... (elided)
[01:18:15] bb0: {
[01:18:15] ... (elided)
[01:18:15] ... (elided)
[01:18:15]     _3 = [closure@HirId { owner: DefIndex(0:4), local_id: 31 }];
[01:18:15] ... (elided)
[01:18:15]     _4 = &_3;
[01:18:15] ... (elided)
[01:18:15]     _6 = &(*_2);
[01:18:15] ... (elided)
[01:18:15]     _7 = &(*_2);
[01:18:15]     _5 = (move _6, move _7);
[01:18:15]     _9 = move (_5.0: &i32);
[01:18:15]     _10 = move (_5.1: &i32);
[01:18:15] ... (elided)
[01:18:15]     _0 = (*_9);
[01:18:15] ... (elided)
[01:18:15]     return;
[01:18:15] }
[01:18:15] ... (elided)
[01:18:15] Actual:
[01:18:15] fn  foo(_1: T, _2: &i32) -> i32 {
[01:18:15]     let mut _0: i32;
[01:18:15]     scope 1 {
[01:18:15]         scope 3 {
[01:18:15]     }
[01:18:15]     scope 2 {
[01:18:15]     scope 2 {
[01:18:15]         let _3: [closure@HirId { owner: DefIndex(0:4), local_id: 31 }];
[01:18:15]     scope 4 {
[01:18:15]     }
[01:18:15]     scope 5 {
[01:18:15]     }
[01:18:15]     }
[01:18:15]     let mut _4: &[closure@HirId { owner: DefIndex(0:4), local_id: 31 }];
[01:18:15]     let mut _5: (&i32, &i32);
[01:18:15]     let mut _6: &i32;
[01:18:15]     let mut _7: &i32;
[01:18:15]     let mut _8: &i32;
[01:18:15]     let mut _9: &i32;
[01:18:15]     bb0: {
[01:18:15]         StorageLive(_3);
[01:18:15]         _3 = [closure@HirId { owner: DefIndex(0:4), local_id: 31 }];
[01:18:15]         StorageLive(_4);
[01:18:15]         _4 = &_3;
[01:18:15]         StorageLive(_5);
[01:18:15]         StorageLive(_6);
[01:18:15]         _6 = &(*_2);
[01:18:15]         StorageLive(_7);
[01:18:15]         _7 = &(*_2);
[01:18:15]         _5 = (move _6, move _7);
[01:18:15]         _8 = move (_5.0: &i32);
[01:18:15]         _9 = move (_5.1: &i32);
[01:18:15]         _0 = (*_8);
[01:18:15]         StorageDead(_5);
[01:18:15]         StorageDead(_7);
[01:18:15]         StorageDead(_6);
[01:18:15]         StorageDead(_4);
[01:18:15]         StorageDead(_3);
[01:18:15]         return;
[01:18:15] }', src/tools/compiletest/src/runtest.rs:3060:13
[01:18:15] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:18:15] 
[01:18:15] 
[01:18:15] 
[01:18:15] failures:
[01:18:15]     [mir-opt] mir-opt/inline-closure-borrows-arg.rs
[01:18:15] 
[01:18:15] test result: FAILED. 41 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
[01:18:15] 
[01:18:15] 
[01:18:15] 
[01:18:15] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/mir-opt" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "mir-opt" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:18:15] 
[01:18:15] 
[01:18:15] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:18:15] Build completed unsuccessfully in 0:12:13
[01:18:15] Build completed unsuccessfully in 0:12:13
[01:18:15] Makefile:48: recipe for target 'check' failed
[01:18:15] make: *** [check] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:1bcfbbcc
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sun Apr 21 10:45:04 UTC 2019
---
travis_time:end:0ee20c21:start=1555843506472803968,finish=1555843506478009901,duration=5205933
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:231a0c00
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@davidtwco davidtwco force-pushed the davidtwco:issue-54716 branch from ec85d21 to 785fe9f Apr 21, 2019

@davidtwco

This comment has been minimized.

Copy link
Member Author

commented Apr 21, 2019

I've updated the test to match what Travis expects, however it isn't the same as I've been seeing locally.

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Apr 21, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:14dfb382:start=1555844588644208428,finish=1555844590926008738,duration=2281800310
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
travis_time:start:test_assembly
Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:14:18] 
[01:14:18] running 9 tests
[01:14:18] iiiiiiiii
[01:14:18] 
[01:14:18]  finished in 0.152
[01:14:18] travis_fold:end:test_assembly

---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:14:34] 
[01:14:34] running 121 tests
[01:15:00] .iiiii...i.....i..i...i..i.i.i..i.ii...i.....i..i....i..........iiii..........i...ii...i.......ii.i. 100/121
[01:15:04] i.i......iii.i.....ii
[01:15:04] 
[01:15:04]  finished in 30.181
[01:15:04] travis_fold:end:test_debuginfo

---
travis_time:start:test_rustdoc
Check compiletest suite=rustdoc mode=rustdoc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:18:59] 
[01:18:59] running 304 tests
[01:20:10] .....F......................i....................................................................... 100/304
[01:22:13] .................................................................................................... 300/304
[01:22:15] ....
[01:22:15] failures:
[01:22:15] 
[01:22:15] 
[01:22:15] ---- [rustdoc] rustdoc/async-fn.rs stdout ----
[01:22:15] 
[01:22:15] error: htmldocck failed!
[01:22:15] status: exit code: 1
[01:22:15] command: "/usr/bin/python2.7" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/async-fn" "/checkout/src/test/rustdoc/async-fn.rs"
[01:22:15] ------------------------------------------
[01:22:15] 
[01:22:15] ------------------------------------------
[01:22:15] stderr:
[01:22:15] stderr:
[01:22:15] ------------------------------------------
[01:22:15] 10: @has check failed
[01:22:15]  `XPATH PATTERN` did not match
[01:22:15]  // @has async_fn/fn.bar.html '//pre[@class="rust fn"]' 'pub async fn bar(a: i32, b: i32) -> i32'
[01:22:15] 15: @has check failed
[01:22:15]  `XPATH PATTERN` did not match
[01:22:15]  // @has async_fn/fn.baz.html '//pre[@class="rust fn"]' 'pub async fn baz<T>(a: T) -> T'
[01:22:15] Encountered 2 errors
[01:22:15] 
[01:22:15] ------------------------------------------
[01:22:15] 
---
[01:22:15] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:517:22
[01:22:15] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:22:15] 
[01:22:15] 
[01:22:15] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--rustdoc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "--src-base" "/checkout/src/test/rustdoc" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "rustdoc" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:22:15] 
[01:22:15] 
[01:22:15] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:22:15] Build completed unsuccessfully in 0:19:36
[01:22:15] Build completed unsuccessfully in 0:19:36
[01:22:15] make: *** [check] Error 1
[01:22:15] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:03394940
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sun Apr 21 12:25:37 UTC 2019
---
travis_time:end:051f3bd6:start=1555849539230765653,finish=1555849539235367297,duration=4601644
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:00667200
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:04ba4860
travis_time:start:04ba4860
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:07dfe26a
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Apr 21, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:2387f0e2:start=1555853738249474647,finish=1555853824135756931,duration=85886282284
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
travis_time:start:test_assembly
Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:16:35] 
[01:16:35] running 9 tests
[01:16:35] iiiiiiiii
[01:16:35] 
[01:16:35]  finished in 0.147
[01:16:35] travis_fold:end:test_assembly

---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:16:51] 
[01:16:51] running 121 tests
[01:17:17] .iiiii...i.....i..i...i..i.i.i..i.ii...i.....i..i....i..........iiii..........i...ii...i.......ii.i. 100/121
[01:17:22] i.i......iii.i.....ii
[01:17:22] 
[01:17:22]  finished in 30.493
[01:17:22] travis_fold:end:test_debuginfo

---
[01:42:53]    Compiling syntax v0.0.0 (/checkout/src/libsyntax)
[01:43:04] error[E0308]: mismatched types
[01:43:04]     --> src/libsyntax/print/pprust.rs:3249:21
[01:43:04]      |
[01:43:04] 3249 | /                     ast::FnHeader {
[01:43:04] 3250 | |                         unsafety: ast::Unsafety::Normal,
[01:43:04] 3251 | |                         constness: source_map::dummy_spanned(ast::Constness::NotConst),
[01:43:04] 3252 | |                         asyncness: source_map::dummy_spanned(ast::IsAsync::NotAsync),
[01:43:04] 3253 | |                         abi: Abi::Rust,
[01:43:04] 3254 | |                     },
[01:43:04]      | |_____________________^ expected reference, found struct `ast::FnHeader`
[01:43:04]      |
[01:43:04]      = note: expected type `&ast::FnHeader`
[01:43:04]                 found type `ast::FnHeader`
[01:43:04]      |
[01:43:04]      |
[01:43:04] 3249 |                     &ast::FnHeader {
[01:43:04] 3250 |                         unsafety: ast::Unsafety::Normal,
[01:43:04] 3251 |                         constness: source_map::dummy_spanned(ast::Constness::NotConst),
[01:43:04] 3252 |                         asyncness: source_map::dummy_spanned(ast::IsAsync::NotAsync),
[01:43:04] 3253 |                         abi: Abi::Rust,
[01:43:04]      |
[01:43:04] 
[01:43:05] error: aborting due to previous error
[01:43:05] 
[01:43:05] 
[01:43:05] For more information about this error, try `rustc --explain E0308`.
[01:43:05] error: Could not compile `syntax`.
[01:43:05] 
[01:43:05] To learn more, run the command again with --verbose.
[01:43:05] 
[01:43:05] 
[01:43:05] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "-p" "syntax" "--" "--quiet"
[01:43:05] 
[01:43:05] 
[01:43:05] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:43:05] Build completed unsuccessfully in 0:38:34
[01:43:05] Build completed unsuccessfully in 0:38:34
[01:43:05] Makefile:48: recipe for target 'check' failed
[01:43:05] make: *** [check] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:041b7de8
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sun Apr 21 15:20:18 UTC 2019
---
travis_time:end:1d5fb14c:start=1555860020188025543,finish=1555860020193282136,duration=5256593
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:078cc00c
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0c759de6
travis_time:start:0c759de6
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:15f99f1e
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

davidtwco added some commits Mar 12, 2019

Add `AsyncArgument` to AST.
This commit adds an `AsyncArgument` struct to the AST that contains the
generated argument and statement that will be used in HIR lowering, name
resolution and def collection.
Move `async fn` arguments into closure.
This commit takes advantage of `AsyncArgument` type that was added in a
previous commit to replace the arguments of the `async fn` in the HIR
and add statements to move the bindings from the new arguments to the
pattern from the old argument.

For example, the async function `foo` below:

    async fn foo((x, _y): (T, V)) {
        async move {
        }
    }

becomes:

    async fn foo(__arg0: (T, V)) {
        async move {
            let (x, _y) = __arg0;
        }
    }
Enforce consistent drop order w/ async methods.
This commit extends the previous commit to apply to trait methods as
well as free functions.
Do not specify type in generated let bindings.
This avoids issues with `impl_trait_in_bindings` as the type from the
argument is normally used as the let binding, but `impl Trait` is
unstable in binding position.
Introduce `ArgSource` for diagnostics.
This commit introduces an `ArgSource` enum that is lowered into the HIR
so that diagnostics can correctly refer to the argument pattern's
original name rather than the generated pattern.
Correct lowering order to avoid ICE after rebase.
This commit changes the order that arguments and bodies of async
functions are lowered so that when the body attempts to `lower_def` of a
upvar then the id has already been assigned by lowering the argument
first.
Display original pattern in rustdoc.
This commit displays the original pattern in generated documentation for
async functions rather than the synthesized pattern.

@davidtwco davidtwco force-pushed the davidtwco:issue-54716 branch from ae4ee36 to 09c707f Apr 21, 2019

@cramertj

This comment has been minimized.

Copy link
Member

commented Apr 23, 2019

r=me with test fixups. This looks great, thanks so much!

Reduce noise and document test case.
This commit introduces a `assert_drop_order_after_poll` helper function
to the test case for this case to reduce repetitive noise and documents
what each function aims to test.
@cramertj

This comment has been minimized.

Copy link
Member

commented Apr 23, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 23, 2019

📌 Commit 119e67a has been approved by cramertj

Centril added a commit to Centril/rust that referenced this pull request Apr 23, 2019

Rollup merge of rust-lang#59823 - davidtwco:issue-54716, r=cramertj
[wg-async-await] Drop `async fn` arguments in async block

Fixes rust-lang#54716.

This PR modifies the HIR lowering (and some other places to make this work) so that unused arguments to a async function are always dropped inside the async move block and not at the end of the function body.

```
async fn foo(<pattern>: <type>) {
  async move {
  }
} // <-- dropped as you "exit" the fn

// ...becomes...
fn foo(__arg0: <ty>) {
  async move {
    let <pattern>: <ty> = __arg0;
  } // <-- dropped as you "exit" the async block
}
```

However, the exact ordering of drops is not the same as a regular function, [as visible in this playground example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=be39af1a58e5d430be1eb3c722cb1ec3) - I believe this to be an unrelated issue. There is a [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/187312-t-compiler.2Fwg-async-await/topic/.2354716.20drop.20order) for this.

r? @cramertj
cc @nikomatsakis
@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 23, 2019

⌛️ Testing commit 119e67a with merge 658f439...

bors added a commit that referenced this pull request Apr 23, 2019

Auto merge of #59823 - davidtwco:issue-54716, r=cramertj
[wg-async-await] Drop `async fn` arguments in async block

Fixes #54716.

This PR modifies the HIR lowering (and some other places to make this work) so that unused arguments to a async function are always dropped inside the async move block and not at the end of the function body.

```
async fn foo(<pattern>: <type>) {
  async move {
  }
} // <-- dropped as you "exit" the fn

// ...becomes...
fn foo(__arg0: <ty>) {
  async move {
    let <pattern>: <ty> = __arg0;
  } // <-- dropped as you "exit" the async block
}
```

However, the exact ordering of drops is not the same as a regular function, [as visible in this playground example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=be39af1a58e5d430be1eb3c722cb1ec3) - I believe this to be an unrelated issue. There is a [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/187312-t-compiler.2Fwg-async-await/topic/.2354716.20drop.20order) for this.

r? @cramertj
cc @nikomatsakis

Centril added a commit to Centril/rust that referenced this pull request Apr 23, 2019

Rollup merge of rust-lang#59823 - davidtwco:issue-54716, r=cramertj
[wg-async-await] Drop `async fn` arguments in async block

Fixes rust-lang#54716.

This PR modifies the HIR lowering (and some other places to make this work) so that unused arguments to a async function are always dropped inside the async move block and not at the end of the function body.

```
async fn foo(<pattern>: <type>) {
  async move {
  }
} // <-- dropped as you "exit" the fn

// ...becomes...
fn foo(__arg0: <ty>) {
  async move {
    let <pattern>: <ty> = __arg0;
  } // <-- dropped as you "exit" the async block
}
```

However, the exact ordering of drops is not the same as a regular function, [as visible in this playground example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=be39af1a58e5d430be1eb3c722cb1ec3) - I believe this to be an unrelated issue. There is a [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/187312-t-compiler.2Fwg-async-await/topic/.2354716.20drop.20order) for this.

r? @cramertj
cc @nikomatsakis

Centril added a commit to Centril/rust that referenced this pull request Apr 23, 2019

Rollup merge of rust-lang#59823 - davidtwco:issue-54716, r=cramertj
[wg-async-await] Drop `async fn` arguments in async block

Fixes rust-lang#54716.

This PR modifies the HIR lowering (and some other places to make this work) so that unused arguments to a async function are always dropped inside the async move block and not at the end of the function body.

```
async fn foo(<pattern>: <type>) {
  async move {
  }
} // <-- dropped as you "exit" the fn

// ...becomes...
fn foo(__arg0: <ty>) {
  async move {
    let <pattern>: <ty> = __arg0;
  } // <-- dropped as you "exit" the async block
}
```

However, the exact ordering of drops is not the same as a regular function, [as visible in this playground example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=be39af1a58e5d430be1eb3c722cb1ec3) - I believe this to be an unrelated issue. There is a [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/187312-t-compiler.2Fwg-async-await/topic/.2354716.20drop.20order) for this.

r? @cramertj
cc @nikomatsakis
@Centril

This comment has been minimized.

Copy link
Member

commented Apr 23, 2019

@bors retry

bors added a commit that referenced this pull request Apr 23, 2019

Auto merge of #60211 - Centril:rollup-akw4r85, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #59823 ([wg-async-await] Drop `async fn` arguments in async block )
 - #59839 (Warn on unused results for operation methods on nums)
 - #60146 (Update fonts used by rustdoc)
 - #60169 (Warn when ignore-tidy-linelength is present, but no lines are too long)
 - #60177 (Promote rust comments to rustdoc)
 - #60191 (Add f16c target_feature)

Failed merges:

r? @ghost

@rust-lang rust-lang deleted a comment from rust-highfive Apr 23, 2019

@bors bors merged commit 119e67a into rust-lang:master Apr 23, 2019

1 of 2 checks passed

homu Testing commit 119e67ac6b7d72c2b314777ba36b2191cbfa7309 with merge 658f439060c837d65724c5902d1f6b3e89239214...
Details
Travis CI - Pull Request Build Passed
Details

@davidtwco davidtwco deleted the davidtwco:issue-54716 branch Apr 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.