Skip to content

Commit 180d582

Browse files
Apply suggestions from code review
Co-authored-by: Tatsuya Kawano <tatsuya@hibaridb.org>
1 parent 8f284ec commit 180d582

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rust-2021/disjoint-capture-in-closures.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ Changing the variables captured by a closure can cause programs to change behavi
118118
Whenever any of the scenarios below are detected, `cargo fix` will insert a "dummy let" into your closure to force it to capture the entire variable:
119119
-->
120120

121-
以下のような状況を検知すると、`cargo fix` "ダミーの let" をクロージャの中に挿入して、強制的に全ての変数がキャプチャされるようにします:
121+
以下のような状況を検知すると、`cargo fix`ダミーの letをクロージャの中に挿入して、強制的に全ての変数がキャプチャされるようにします:
122122

123123
```rust
124124
let x = (vec![22], vec![23]);
125125
let c = move || {
126126
// "Dummy let" that forces `x` to be captured in its entirety
127-
// `x` 全体が強制的にキャプチャされるための "ダミーの let"
127+
// `x` 全体が強制的にキャプチャされるためのダミーの let
128128
let _ = &x;
129129

130130
// Otherwise, only `x.0` would be captured here
@@ -289,7 +289,7 @@ Closures automatically implement the following traits based on what values they
289289
[`clone`]: https://doc.rust-lang.org/std/clone/trait.Clone.html
290290
[`send`]: https://doc.rust-lang.org/std/marker/trait.Send.html
291291
[`sync`]: https://doc.rust-lang.org/std/marker/trait.Sync.html
292-
[`unwindsafe`]: https://doc.rust-lang.org/std/marker/trait.UnwindSafe.html
292+
[`unwindsafe`]: https://doc.rust-lang.org/std/panic/trait.UnwindSafe.html
293293

294294
<!--
295295
In Rust 2021, since different values are being captured, this can affect what traits a closure will implement. The migration lints test each closure to see whether it would have implemented a given trait before and whether it still implements it now; if they find that a trait used to be implemented but no longer is, then "dummy lets" are inserted.

0 commit comments

Comments
 (0)