File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -142,12 +142,21 @@ possible cause trouble by being incorrectly Send or Sync.
142
142
してください。他のアンセーフなコードによって特別な意味を持ってしまった型のみが、
143
143
不正な Send や Sync によって問題を引き起こしてしまう可能性があります。
144
144
145
+ <!--
145
146
Most uses of raw pointers should be encapsulated behind a sufficient abstraction
146
147
that Send and Sync can be derived. For instance all of Rust's standard
147
148
collections are Send and Sync (when they contain Send and Sync types) in spite
148
149
of their pervasive use of raw pointers to manage allocations and complex ownership.
149
150
Similarly, most iterators into these collections are Send and Sync because they
150
151
largely behave like an `&` or `&mut` into the collection.
152
+ -->
153
+
154
+ 生ポインタの使用者のほとんどは、 Send や Sync を継承できるよう、十分な抽象化の裏に
155
+ 生ポインタをカプセル化するべきです。例えば Rust の全ての標準コレクションは、
156
+ アロケーションや複雑な所有権を操るために至るところで生ポインタを使用しているのにも関わらず、
157
+ Send と Sync を実装しています (これらの型が Send と Sync を実装している型を保持している場合) 。
158
+ 同じように、これらのコレクションのほとんどのイテレータは、イテレータがコレクションに対して
159
+ ` & ` や ` &mut ` のように振る舞っているために、 Send や Sync を実装しています。
151
160
152
161
TODO: better explain what can or can't be Send or Sync. Sufficient to appeal
153
162
only to data races?
You can’t perform that action at this time.
0 commit comments