sync content (#157)

* Sync the original contents:upgrade syn crate to version 2.0

* Sync content
This commit is contained in:
trackers-lover 2024-04-28 09:02:12 +08:00 committed by GitHub
parent d6cdce4b04
commit eecb6e97cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -90,7 +90,7 @@ Here, `x` has the lifetime `'b`, which in this case is larger than `'a`. This
means `r` can reference `x` because Rust knows that the reference in `r` will
always be valid while `x` is valid.
Now that you know where the lifetimes of references are and how Rust analyzes
Now that you know what the lifetimes of references are and how Rust analyzes
lifetimes to ensure references will always be valid, lets explore generic
lifetimes of parameters and return values in the context of functions.

View File

@ -80,7 +80,7 @@ Rust 编译器有一个 **借用检查器***borrow checker*),它比较作
这里 `x` 拥有生命周期 `'b`,比 `'a` 要大。这就意味着 `r` 可以引用 `x`Rust 知道 `r` 中的引用在 `x` 有效的时候也总是有效的。
现在我们已经在一个具体的例子中展示了引用的生命周期位于何处,并讨论了 Rust 如何分析生命周期来保证引用总是有效的,接下来让我们聊聊在函数的上下文中参数和返回值的泛型生命周期。
现在我们已经在一个具体的例子中展示了什么是引用的生命周期,并讨论了 Rust 如何分析生命周期来保证引用总是有效的,接下来让我们聊聊在函数的上下文中参数和返回值的泛型生命周期。
### 函数中的泛型生命周期