From 49e8318b0c4329b668b97b496e3cc044923e4504 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Fri, 11 Jan 2019 13:58:13 -0800 Subject: [PATCH] Fixing a typographical error. --- src/librustc_mir/diagnostics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_mir/diagnostics.rs b/src/librustc_mir/diagnostics.rs index 7e8ac3fb72006..212edaaa1ba66 100644 --- a/src/librustc_mir/diagnostics.rs +++ b/src/librustc_mir/diagnostics.rs @@ -2334,7 +2334,7 @@ local variable that already exists, and hence no temporary is created. Temporaries are not always dropped at the end of the enclosing statement. In simple cases where the `&` expression is immediately stored into a variable, the compiler will automatically extend -the lifetime of the temporary until the end of the enclosinb +the lifetime of the temporary until the end of the enclosing block. Therefore, an alternative way to fix the original program is to write `let tmp = &foo()` and not `let tmp = foo()`: