摘要: 避免悬垂引用 //这样写会报错fn main { let r; { let x=5; r=&x; } //`x` dropped here while still borrowed println!("r is {}",r); } 函数中的生命周期 fn longest<'a>(x:&'a str, 阅读全文
posted @ 2023-02-27 18:02 丢丢乱射 阅读(69) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示