Skip to content

Commit 3298481

Browse files
Fix hackmd-ism
1 parent b2a8e07 commit 3298481

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

text/3668-async-closure.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ The reason that these implementations are built-in is because using blanket impl
303303

304304
Some stable types that implement `async Fn()` today include, e.g.:
305305

306-
```rust!
306+
```rust
307307
// Async functions:
308308
async fn foo() {}
309309

@@ -361,7 +361,7 @@ The closure captures `vec` with some `&'closure mut Vec<String>` which lives unt
361361

362362
As another example:
363363

364-
```rust!
364+
```rust
365365
let string: String = "Hello, world".into();
366366

367367
let closure = async move || {
@@ -510,21 +510,21 @@ These limitations, plus the fact that the underlying trait should have no effect
510510

511511
`async ||` is analogous with `async fn`, and has an intuitive, first-class way to declare the return type of the future:
512512

513-
```rust!
513+
```rust
514514
let c = async || -> i32 { 0 };
515515
```
516516

517517
There isn't currently a way to annotate the future's return type in a closure that returns a future:
518518

519-
```rust!
519+
```rust
520520
let c = || -> /* ??? */ async { 0 };
521521
```
522522

523523
We could reuse `impl Future` to give users the ability to annotate the type of the future returned by the closure in this position, but it would require giving yet another subtly different meaning to `impl Trait`, since async closures return a *different* type when being called by-ref or by-move.
524524

525525
This also would have subtle limitations, e.g.:
526526

527-
```rust!
527+
```rust
528528
// Easy to reanalyze as an async closure.
529529
let _ = || async { do_stuff().await };
530530

@@ -556,7 +556,7 @@ We should be able to detect when users write `|| async {}` -- and subsequently h
556556

557557
A similar problem could occur if users try to write "old style" trait bounds with two generic parameters `F: Fn() -> Fut` and `Fut: Future<Output = T>`. For example:
558558

559-
```rust!
559+
```rust
560560
async fn for_each_city<F, Fut>(cb: F)
561561
where
562562
F: Fn(&str) -> Fut,

0 commit comments

Comments
 (0)