In the following code , line A works , it is unexpected , because &mut u8 is not Clone. For the cloned one
It has different semantic : it seems a Box::<u8>
Seems an violation of the signature of fn clone(&self) -> Self;
How to explain this?
fn main() {
let mut a = 0u8;
let b = Box::new(&mut a);
let c = b.clone(); // A compile , unexpected
println!("{}",size_of_val(&b)); // output is 8
println!("{}",size_of_val(&c)); // output is 1
}