Skip to content

Commit

Permalink
fix ci failures, typos, broken links
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-i-m committed Jun 15, 2019
1 parent 9a4ff92 commit c15c609
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/borrow_check/two_phase_borrows.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ two-phase borrow are:

To give some examples:

```rust
```rust2018
// In the source code
// Case 1:
Expand Down
6 changes: 3 additions & 3 deletions src/closure.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit c15c609

Please sign in to comment.