compiler/fight-with-compiler/lifetime/closure-with-static #997
Replies: 4 comments 2 replies
-
菜鸟提问:本篇说没有引用字段的结构体也拥有 |
Beta Was this translation helpful? Give feedback.
-
这里看第二遍,结合项目实践中遇到的问题,终于彻底搞明白了。写得太好了 |
Beta Was this translation helpful? Give feedback.
-
引入生命周期'b的那个,第一次遇到这种因为先drop先后顺序带来的生命周期问题。 |
Beta Was this translation helpful? Give feedback.
-
对于本篇中这句话:
fn main() {
let string = "local string".to_string();
print_static_trait_object(&string);
}
fn print_static_trait_object(item: &'static dyn std::fmt::Display) {
println!("{}", item);
} 这里 |
Beta Was this translation helpful? Give feedback.
-
compiler/fight-with-compiler/lifetime/closure-with-static
https://course.rs/compiler/fight-with-compiler/lifetime/closure-with-static.html
Beta Was this translation helpful? Give feedback.
All reactions