@@ -135,23 +135,23 @@ appropriate trait: `Fn` trait for immutable borrow, `FnMut` for mutable borrow,
135135and ` FnOnce ` for move semantics.
136136
137137Most 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
139139declared in the file [ ` compiler/rustc_middle/src/ty/mod.rs ` ] [ ty ] .
140140
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
142142[ ty ] :https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/index.html
143143
144144Before we go any further, let's discuss how we can examine the flow of control through the rustc
145145codebase. For closures specifically, set the ` RUST_LOG ` env variable as below and collect the
146146output in a file:
147147
148148``` 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 \
150150 <.rs file to compile> 2> <file where the output will be dumped>
151151```
152152
153153This uses the stage1 compiler and enables ` debug! ` logging for the
154- ` rustc_typeck::check ::upvar` module.
154+ ` rustc_hir_typeck ::upvar` module.
155155
156156The other option is to step through the code using lldb or gdb.
157157
@@ -164,7 +164,7 @@ Let's start with [`upvar.rs`][upvar]. This file has something called
164164the [ ` euv::ExprUseVisitor ` ] which walks the source of the closure and
165165invokes a callback for each upvar that is borrowed, mutated, or moved.
166166
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
168168
169169``` rust
170170fn main () {
@@ -210,6 +210,6 @@ self.tables
210210 .extend(delegate.adjust_upvar_captures);
211211```
212212
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