mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-02-03 07:48:41 +08:00
Add another question we need to answer
This commit is contained in:
parent
befd5f681c
commit
e28b78dc2b
@ -240,7 +240,8 @@ note: borrowed value must be valid for the lifetime 'a as defined on the block a
|
|||||||
```
|
```
|
||||||
|
|
||||||
Now we have our "does not live long enough" error. What gives? Why does Rust
|
Now we have our "does not live long enough" error. What gives? Why does Rust
|
||||||
need this parameter in the first place?
|
need this parameter in the first place? And why didn't adding this parameter
|
||||||
|
fix the error?
|
||||||
|
|
||||||
When we have code inside of a function, Rust can analyze that specific case.
|
When we have code inside of a function, Rust can analyze that specific case.
|
||||||
There's only one thing to look at. But functions get called multiple times. So
|
There's only one thing to look at. But functions get called multiple times. So
|
||||||
|
Loading…
Reference in New Issue
Block a user