about summary refs log tree commit diff
path: root/src/test/run-pass/issue-54716.rs
AgeCommit message (Collapse)AuthorLines
2019-05-01Ensure that drop order of `async fn` matches `fn`.David Wood-184/+0
This commit modifies the lowering of `async fn` arguments so that the drop order matches the equivalent `fn`. Previously, async function arguments were lowered as shown below: async fn foo(<pattern>: <ty>) { async move { } } // <-- dropped as you "exit" the fn // ...becomes... fn foo(__arg0: <ty>) { async move { let <pattern> = __arg0; } // <-- dropped as you "exit" the async block } After this PR, async function arguments will be lowered as: async fn foo(<pattern>: <ty>, <pattern>: <ty>, <pattern>: <ty>) { async move { } } // <-- dropped as you "exit" the fn // ...becomes... fn foo(__arg0: <ty>, __arg1: <ty>, __arg2: <ty>) { async move { let __arg2 = __arg2; let <pattern> = __arg2; let __arg1 = __arg1; let <pattern> = __arg1; let __arg0 = __arg0; let <pattern> = __arg0; } // <-- dropped as you "exit" the async block } If `<pattern>` is a simple ident, then it is lowered to a single `let <pattern> = <pattern>;` statement as an optimization.
2019-04-23Stabilize futures_apiTaylor Cramer-1/+1
2019-04-23Reduce noise and document test case.David Wood-91/+83
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.
2019-04-21Enforce consistent drop order w/ async methods.David Wood-0/+103
This commit extends the previous commit to apply to trait methods as well as free functions.
2019-04-21Add test for drop order in async functions.David Wood-0/+89
This tests that async functions drop parameters in the same order as regular functions.