From 9433b3b3df0d721b11049c6340ab7eba85419514 Mon Sep 17 00:00:00 2001 From: zhaoshouhang Date: Fri, 7 Apr 2023 21:26:57 +0800 Subject: [PATCH] Update advance.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 极具->急剧 --- src/advance/lifetime/advance.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/advance/lifetime/advance.md b/src/advance/lifetime/advance.md index d0372024..192cba7c 100644 --- a/src/advance/lifetime/advance.md +++ b/src/advance/lifetime/advance.md @@ -250,7 +250,7 @@ fn fn_elision(x: &i32) -> &i32 {..} let closure_slision = |x: &i32| -> &i32 { x }; ``` -编译器就必须深入到闭包函数体中,去分析和推测生命周期,复杂度因此极具提升:试想一下,编译器该如何从复杂的上下文中分析出参数引用的生命周期和闭包体中生命周期的关系? +编译器就必须深入到闭包函数体中,去分析和推测生命周期,复杂度因此急剧提升:试想一下,编译器该如何从复杂的上下文中分析出参数引用的生命周期和闭包体中生命周期的关系? 由于上述原因(当然,实际情况复杂的多),Rust 语言开发者目前其实是有意针对函数和闭包实现了两种不同的生命周期消除规则。