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);
93
93
94
94
# FFI
95
95
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
97
97
C’s `const T*` and `T*`, respectively. For more about this use, consult the
98
- [ FFI chapter] [ ffi ] .
98
+ [FFI chapter][ffi]. -->
99
99
生ポインタはFFIを使う際に役立ちます。Rustの ` *const T ` と ` *mut T ` はそれぞれC言語の ` const T* ` と ` T* ` に似ているからです。これの使い方に関する詳細は、 [ FFIの章] [ ffi ] を参照してください。
100
100
101
101
[ ffi ] : ffi.html
@@ -117,7 +117,7 @@ satisfy the aliasing and mutability laws of references. The compiler assumes
117
117
these properties are true for any references, no matter how they are created,
118
118
and so any conversion from raw pointers is asserting that they hold. The
119
119
programmer *must* guarantee this. -->
120
- 逆に、 ` *const ` から 参照 ` & ` へ遡るのは安全ではありません。 ` &T ` は常に有効であるため、最低でも ` *const T ` は型 ` T ` の有効な実体を指さなければならないのです。その上、ポインタは参照のエイリアシングとミュータビリティの規則も満たす必要があります。コンパイラはあらゆる参照についてこれらのプロパティが真であると仮定しており、その生成方法によらず適用するため、生ポインタからのあらゆる変換もまた真であると断言します。プログラマがこのことを保証 _ しなければならない _ のです。
120
+ 逆に、 ` *const ` から 参照 ` & ` へ遡るのは安全ではありません。 ` &T ` は常に有効であるため、最低でも ` *const T ` は型 ` T ` の有効な実体を指さなければならないのです。その上、ポインタは参照のエイリアシングとミュータビリティの規則も満たす必要があります。コンパイラはあらゆる参照についてこれらのプロパティが真であると仮定しており、その生成方法によらず適用するため、生ポインタからのあらゆる変換もまた真であると断言します。プログラマがこのことを保証 * しなければならない * のです。
121
121
122
122
<!-- The recommended method for the conversion is: -->
123
123
おすすめの変換の方法は以下のとおりです。
You can’t perform that action at this time.
0 commit comments