Skip to content

Commit

Permalink
lifetime elision: document conformance of 'async fn' to 'fn'.
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Aug 8, 2019
1 parent a694782 commit d9294a2
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/test/ui/self/elision/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,34 @@ In each case, we test the following patterns:
- `self: Box<Pin<XXX>>`

In the non-reference cases, `Pin` causes errors so we substitute `Rc`.

### `async fn`

For each of the tests above we also check that `async fn` behaves as an `fn` would.
These tests are in files named `*-async.rs`.

Legends:
- ✓ ⟹ Yes / Pass
- X ⟹ No
- α ⟹ lifetime mismatch
- β ⟹ cannot infer an appropriate lifetime
- γ ⟹ missing lifetime specifier

| `async` file | Pass? | Conforms to `fn`? | How does it diverge? <br/> `fn``async fn` |
| --- | --- | --- | --- |
| `self-async.rs` ||| N/A |
| `struct-async.rs`||| N/A |
| `alias-async.rs`||| N/A |
| `assoc-async.rs`||| N/A |
| `ref-self-async.rs` | X | X | α ⟶ β + γ |
| `ref-mut-self-async.rs` | X | X | α ⟶ β + γ |
| `ref-struct-async.rs` | X | X | α ⟶ β + γ |
| `ref-mut-struct-async.rs` | X | X | α ⟶ β + γ |
| `ref-alias-async.rs` | X | X | ✓ ⟶ β + γ |
| `ref-assoc-async.rs` | X | X | ✓ ⟶ β + γ |
| `ref-mut-alias-async.rs` | X | X | ✓ ⟶ β + γ |
| `lt-self-async.rs` | ✓ | ✓ | N/A
| `lt-struct-async.rs` | ✓ | ✓ | N/A
| `lt-alias-async.rs` | ✓ | ✓ | N/A
| `lt-assoc-async.rs` | ✓ | ✓ | N/A
| `lt-ref-self-async.rs` | X | X | α ⟶ β + γ

0 comments on commit d9294a2

Please sign in to comment.