File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -93,9 +93,9 @@ println!("raw points at {}", points_at);
9393
9494# FFI
9595
96- Raw pointers are useful for FFI: Rust’s ` *const T ` and ` *mut T ` are similar to
96+ <!-- Raw pointers are useful for FFI: Rust’s `*const T` and `*mut T` are similar to
9797C’s `const T*` and `T*`, respectively. For more about this use, consult the
98- [ FFI chapter] [ ffi ] .
98+ [FFI chapter][ffi]. -->
9999生ポインタはFFIを使う際に役立ちます。Rustの ` *const T ` と ` *mut T ` はそれぞれC言語の ` const T* ` と ` T* ` に似ているからです。これの使い方に関する詳細は、 [ FFIの章] [ ffi ] を参照してください。
100100
101101[ ffi ] : ffi.html
@@ -117,7 +117,7 @@ satisfy the aliasing and mutability laws of references. The compiler assumes
117117these properties are true for any references, no matter how they are created,
118118and so any conversion from raw pointers is asserting that they hold. The
119119programmer *must* guarantee this. -->
120- 逆に、 ` *const ` から 参照 ` & ` へ遡るのは安全ではありません。 ` &T ` は常に有効であるため、最低でも ` *const T ` は型 ` T ` の有効な実体を指さなければならないのです。その上、ポインタは参照のエイリアシングとミュータビリティの規則も満たす必要があります。コンパイラはあらゆる参照についてこれらのプロパティが真であると仮定しており、その生成方法によらず適用するため、生ポインタからのあらゆる変換もまた真であると断言します。プログラマがこのことを保証 _ しなければならない _ のです。
120+ 逆に、 ` *const ` から 参照 ` & ` へ遡るのは安全ではありません。 ` &T ` は常に有効であるため、最低でも ` *const T ` は型 ` T ` の有効な実体を指さなければならないのです。その上、ポインタは参照のエイリアシングとミュータビリティの規則も満たす必要があります。コンパイラはあらゆる参照についてこれらのプロパティが真であると仮定しており、その生成方法によらず適用するため、生ポインタからのあらゆる変換もまた真であると断言します。プログラマがこのことを保証 * しなければならない * のです。
121121
122122<!-- The recommended method for the conversion is: -->
123123おすすめの変換の方法は以下のとおりです。
You can’t perform that action at this time.
0 commit comments