You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
在这小节中, 前面说转换所有权, 后面又说所有权并未转移, 前后有矛盾, 并且在下面的代码示例中, 我觉得注释应该是有问题
let arr1 = arr;
实际上应该是i32
数组在标准里有默认实现Copy
:impl<T: Copy, const N: usize> for [T; N]
我想作者应该是想表达, 在栈上的数据, 会被复制出一份, 然后再 bound to 新的变量 a -> c 变成 b -> c',
而堆上的数据是指针的复制, 由 a -> c 变量 b -> c
Beta Was this translation helpful? Give feedback.
All reactions