File tree Expand file tree Collapse file tree 5 files changed +78
-0
lines changed Expand file tree Collapse file tree 5 files changed +78
-0
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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 /
Original file line number Diff line number Diff line change 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" ] }
Original file line number Diff line number Diff line change 1+ # Result
2+
3+ ``` bash
4+
5+ async 8
6+ ```
7+
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments