Skip to content

Commit c15c609

Browse files
committed
fix ci failures, typos, broken links
1 parent 9a4ff92 commit c15c609

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/borrow_check/two_phase_borrows.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ two-phase borrow are:
1515

1616
To give some examples:
1717

18-
```rust
18+
```rust2018
1919
// In the source code
2020
2121
// Case 1:

src/closure.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ Let's start with defining a term that we will be using quite a bit in the rest o
115115
*upvar*. An **upvar** is a variable that is local to the function where the closure is defined. So,
116116
in the above examples, **x** will be an upvar to the closure. They are also sometimes referred to as
117117
the *free variables* meaning they are not bound to the context of the closure.
118-
[`src/librustc/ty/query/mod.rs`][freevars] defines a query called *freevars* for this purpose.
118+
[`src/librustc/ty/query/mod.rs`][upvars] defines a query called *upvars* for this purpose.
119119

120-
[freevars]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/query/queries/struct.freevars.html
120+
[upvars]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/query/queries/struct.upvars.html
121121

122122
Other than lazy invocation, one other thing that the distinguishes a closure from a
123123
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.
167167

168168
```rust
169169
fn main() {
170-
let x = vec![21];
170+
let mut x = vec![21];
171171
let _cl = || {
172172
let y = x[0]; // 1.
173173
x[0] += 1; // 2.

0 commit comments

Comments
 (0)