From 430948ac178cc34f22ae01969a850faf27369c20 Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Sat, 15 Jun 2019 16:54:08 -0500 Subject: [PATCH] fix ci failures, typos, broken links --- src/borrow_check/two_phase_borrows.md | 2 +- src/closure.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/borrow_check/two_phase_borrows.md b/src/borrow_check/two_phase_borrows.md index 753ffa5b..09e7fbef 100644 --- a/src/borrow_check/two_phase_borrows.md +++ b/src/borrow_check/two_phase_borrows.md @@ -15,7 +15,7 @@ two-phase borrow are: To give some examples: -```rust +```rust2018 // In the source code // Case 1: diff --git a/src/closure.md b/src/closure.md index a31893b0..77f2b42c 100644 --- a/src/closure.md +++ b/src/closure.md @@ -115,9 +115,9 @@ Let's start with defining a term that we will be using quite a bit in the rest o *upvar*. An **upvar** is a variable that is local to the function where the closure is defined. So, in the above examples, **x** will be an upvar to the closure. They are also sometimes referred to as the *free variables* meaning they are not bound to the context of the closure. -[`src/librustc/ty/query/mod.rs`][freevars] defines a query called *freevars* for this purpose. +[`src/librustc/ty/query/mod.rs`][upvars] defines a query called *upvars* for this purpose. -[freevars]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/query/queries/struct.freevars.html +[upvars]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/query/queries/struct.upvars.html Other than lazy invocation, one other thing that the distinguishes a closure from a normal function is that it can use the upvars. It borrows these upvars from its surrounding @@ -167,7 +167,7 @@ invokes a callbackfor each upvar that is borrowed, mutated, or moved. ```rust fn main() { - let x = vec![21]; + let mut x = vec![21]; let _cl = || { let y = x[0]; // 1. x[0] += 1; // 2.