@@ -135,23 +135,23 @@ appropriate trait: `Fn` trait for immutable borrow, `FnMut` for mutable borrow,
135
135
and ` FnOnce ` for move semantics.
136
136
137
137
Most of the code related to the closure is in the
138
- [ ` compiler/rustc_typeck /src/check /upvar.rs ` ] [ upvar ] file and the data structures are
138
+ [ ` compiler/rustc_hir_typeck /src/upvar.rs ` ] [ upvar ] file and the data structures are
139
139
declared in the file [ ` compiler/rustc_middle/src/ty/mod.rs ` ] [ ty ] .
140
140
141
- [ upvar ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check /upvar/index.html
141
+ [ upvar ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck /upvar/index.html
142
142
[ ty ] :https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/index.html
143
143
144
144
Before we go any further, let's discuss how we can examine the flow of control through the rustc
145
145
codebase. For closures specifically, set the ` RUST_LOG ` env variable as below and collect the
146
146
output in a file:
147
147
148
148
``` console
149
- > RUST_LOG=rustc_typeck::check ::upvar rustc +stage1 -Z dump-mir=all \
149
+ > RUST_LOG=rustc_hir_typeck ::upvar rustc +stage1 -Z dump-mir=all \
150
150
<.rs file to compile> 2> <file where the output will be dumped>
151
151
```
152
152
153
153
This uses the stage1 compiler and enables ` debug! ` logging for the
154
- ` rustc_typeck::check ::upvar` module.
154
+ ` rustc_hir_typeck ::upvar` module.
155
155
156
156
The other option is to step through the code using lldb or gdb.
157
157
@@ -164,7 +164,7 @@ Let's start with [`upvar.rs`][upvar]. This file has something called
164
164
the [ ` euv::ExprUseVisitor ` ] which walks the source of the closure and
165
165
invokes a callback for each upvar that is borrowed, mutated, or moved.
166
166
167
- [ `euv::ExprUseVisitor` ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck /expr_use_visitor/struct.ExprUseVisitor.html
167
+ [ `euv::ExprUseVisitor` ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck /expr_use_visitor/struct.ExprUseVisitor.html
168
168
169
169
``` rust
170
170
fn main () {
@@ -210,6 +210,6 @@ self.tables
210
210
.extend(delegate.adjust_upvar_captures);
211
211
```
212
212
213
- [ `Delegate` ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck /expr_use_visitor/trait.Delegate.html
214
- [ ibk ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check /upvar/struct.InferBorrowKind.html
215
- [ cmt ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck /mem_categorization/index.html
213
+ [ `Delegate` ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck /expr_use_visitor/trait.Delegate.html
214
+ [ ibk ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck /upvar/struct.InferBorrowKind.html
215
+ [ cmt ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck /mem_categorization/index.html
0 commit comments