How does compiler infer that Box is borrowing the one which its content borrows?

后端 未结 0 860
长情又很酷
长情又很酷 2021-01-05 17:56
let s: String = String::from("some message");

let b: Box<&String> = Box::<&String>::new(&s);

drop(s);

let another_box = b; // er         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题