mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 20:49:41 +00:00
no -> not
This commit is contained in:
@ -108,7 +108,7 @@ fn main() {
|
|||||||
## T: 'static
|
## T: 'static
|
||||||
As a trait bound, it means the type does not contain any non-static references. Eg. the receiver can hold on to the type for as long as they want and it will never become invalid until they drop it.
|
As a trait bound, it means the type does not contain any non-static references. Eg. the receiver can hold on to the type for as long as they want and it will never become invalid until they drop it.
|
||||||
|
|
||||||
It's important to understand this means that any owned data always passes a `'static `lifetime bound, but a reference to that owned data generally does no。
|
It's important to understand this means that any owned data always passes a `'static `lifetime bound, but a reference to that owned data generally does not.
|
||||||
|
|
||||||
5、🌟🌟
|
5、🌟🌟
|
||||||
```rust,editable
|
```rust,editable
|
||||||
@ -192,4 +192,4 @@ fn print_f(t: &(impl Display + 'static)) {
|
|||||||
fn print_g(t: &'static String) {
|
fn print_g(t: &'static String) {
|
||||||
println!("{}", t);
|
println!("{}", t);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user