Box::into_raw()返回的是一个*mut T

文中的116行数据类型可能有错误,不知道是不是我理解错误,我看函数签名返回的是*mut T.
pull/875/head
CrazyCoder_LJ 3 years ago committed by GitHub
parent 905007e212
commit a6c395a197
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -113,7 +113,7 @@ let a: Box<i32> = Box::new(10);
// 需要先解引用a // 需要先解引用a
let b: *const i32 = &*a; let b: *const i32 = &*a;
// 使用 into_raw 来创建 // 使用 into_raw 来创建
let c: *const i32 = Box::into_raw(a); let c: *mut i32 = Box::into_raw(a);
``` ```
#### 小结 #### 小结

Loading…
Cancel
Save