Skip to content

Commit d9294a2

Browse files
committed
lifetime elision: document conformance of 'async fn' to 'fn'.
1 parent a694782 commit d9294a2

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/test/ui/self/elision/README.md

+31
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,34 @@ In each case, we test the following patterns:
4242
- `self: Box<Pin<XXX>>`
4343

4444
In the non-reference cases, `Pin` causes errors so we substitute `Rc`.
45+
46+
### `async fn`
47+
48+
For each of the tests above we also check that `async fn` behaves as an `fn` would.
49+
These tests are in files named `*-async.rs`.
50+
51+
Legends:
52+
- ✓ ⟹ Yes / Pass
53+
- X ⟹ No
54+
- α ⟹ lifetime mismatch
55+
- β ⟹ cannot infer an appropriate lifetime
56+
- γ ⟹ missing lifetime specifier
57+
58+
| `async` file | Pass? | Conforms to `fn`? | How does it diverge? <br/> `fn``async fn` |
59+
| --- | --- | --- | --- |
60+
| `self-async.rs` ||| N/A |
61+
| `struct-async.rs`||| N/A |
62+
| `alias-async.rs`||| N/A |
63+
| `assoc-async.rs`||| N/A |
64+
| `ref-self-async.rs` | X | X | α ⟶ β + γ |
65+
| `ref-mut-self-async.rs` | X | X | α ⟶ β + γ |
66+
| `ref-struct-async.rs` | X | X | α ⟶ β + γ |
67+
| `ref-mut-struct-async.rs` | X | X | α ⟶ β + γ |
68+
| `ref-alias-async.rs` | X | X | ✓ ⟶ β + γ |
69+
| `ref-assoc-async.rs` | X | X | ✓ ⟶ β + γ |
70+
| `ref-mut-alias-async.rs` | X | X | ✓ ⟶ β + γ |
71+
| `lt-self-async.rs` | ✓ | ✓ | N/A
72+
| `lt-struct-async.rs` | ✓ | ✓ | N/A
73+
| `lt-alias-async.rs` | ✓ | ✓ | N/A
74+
| `lt-assoc-async.rs` | ✓ | ✓ | N/A
75+
| `lt-ref-self-async.rs` | X | X | α ⟶ β + γ

0 commit comments

Comments
 (0)