Skip to content

Commit 3159f6c

Browse files
committed
https://github.com/rust-lang/rust/pull/104134
1 parent 420c9f3 commit 3159f6c

File tree

5 files changed

+78
-0
lines changed

5 files changed

+78
-0
lines changed

rust1_75/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@
66
- https://blog.rust-lang.org/2023/12/11/cargo-cache-cleaning.html
77
- https://rust-lang.github.io/rfcs/3425-return-position-impl-trait-in-traits.html
88

9+
- https://github.com/rust-lang/rust/pull/104134
10+
11+
```rs
12+
13+
#![allow(unreachable_code)]
14+
15+
async fn f(_: u8) {}
16+
17+
async fn g() {
18+
f(todo!("...")).await;
19+
}
20+
21+
fn require_send(_: impl Send) {}
22+
23+
fn main() {
24+
require_send(g());
25+
}
26+
```
927

1028

1129
# Rust Clippy
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Visual Studio 2015/2017 cache/options directory
2+
.vs/
3+
4+
# A collection of useful .gitignore templates
5+
# https://github.com/github/gitignore\xa
6+
# General
7+
.DS_Store
8+
dir/otherdir/.DS_Store
9+
10+
# VS Code files for those working on multiple tools
11+
.vscode/
12+
# Generated by Cargo
13+
# will have compiled files and executables
14+
debug/
15+
target/
16+
17+
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
18+
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
19+
Cargo.lock
20+
21+
# These are backup files generated by rustfmt
22+
**/*.rs.bk
23+
24+
# MSVC Windows builds of rustc generate these, which store debugging information
25+
*.pdb
26+
27+
# WASM
28+
pkg/
29+
/wasm-pack.log
30+
dist/
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[package]
2+
name = "f01_async_fn_closure"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
9+
tokio = { version = "1.37.0", features = ["full"] }
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Result
2+
3+
```bash
4+
5+
async 8
6+
```
7+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
async fn f(number: u8) {
2+
println!("async {number}");
3+
}
4+
5+
async fn g() {
6+
f(8).await;
7+
}
8+
9+
fn require_send(_: impl Send) {}
10+
11+
#[tokio::main]
12+
async fn main() {
13+
require_send(g().await);
14+
}

0 commit comments

Comments
 (0)