Skip to content

Commit 736fcb9

Browse files
lcnrJohnTitor
andauthored
fix some links (rust-lang#1490)
Co-authored-by: Yuki Okushi <jtitor@2k36.org>
1 parent a8ccc26 commit 736fcb9

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

src/closure.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -135,23 +135,23 @@ appropriate trait: `Fn` trait for immutable borrow, `FnMut` for mutable borrow,
135135
and `FnOnce` for move semantics.
136136

137137
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
139139
declared 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

144144
Before we go any further, let's discuss how we can examine the flow of control through the rustc
145145
codebase. For closures specifically, set the `RUST_LOG` env variable as below and collect the
146146
output 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

153153
This uses the stage1 compiler and enables `debug!` logging for the
154-
`rustc_typeck::check::upvar` module.
154+
`rustc_hir_typeck::upvar` module.
155155

156156
The 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
164164
the [`euv::ExprUseVisitor`] which walks the source of the closure and
165165
invokes 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
170170
fn 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

src/generics.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ You may have a couple of followup questions…
125125
`MyStruct`: `Adt(Foo, &[Param(0), Param(1)])`.
126126

127127
**`subst`** How do we actually do the substitutions? There is a function for that too! You use
128-
[`subst`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/subst/trait.Subst.html) to
128+
[`subst`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/subst/struct.EarlyBinder.html#method.subst) to
129129
replace a `SubstRef` with another list of types.
130130

131131
[Here is an example of actually using `subst` in the compiler][substex]. The exact details are not
@@ -134,7 +134,7 @@ a real `ty::Ty`. You can see that we first get some substitutions (`substs`). T
134134
`type_of` to get a type and call `ty.subst(substs)` to get a new version of `ty` with
135135
the substitutions made.
136136

137-
[substex]: https://github.com/rust-lang/rust/blob/597f432489f12a3f33419daa039ccef11a12c4fd/src/librustc_typeck/astconv.rs#L942-L953
137+
[substex]: https://github.com/rust-lang/rust/blob/0940040c0486a536be4f8685c7dd9a078f9e87c2/compiler/rustc_hir_analysis/src/astconv/mod.rs#L1231-L1242
138138

139139
**Note on indices:** It is possible for the indices in `Param` to not match with what we expect. For
140140
example, the index could be out of bounds or it could be the index of a lifetime when we were

src/method-lookup.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ inference variables or other information.
3232

3333
[fully-qualified syntax]: https://doc.rust-lang.org/nightly/book/ch19-03-advanced-traits.html#fully-qualified-syntax-for-disambiguation-calling-methods-with-the-same-name
3434
[UFCS]: https://github.com/rust-lang/rfcs/blob/master/text/0132-ufcs.md
35-
[probe]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/method/probe/
36-
[confirm]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/method/confirm/
35+
[probe]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/method/probe/
36+
[confirm]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/method/confirm/
3737

3838
## The Probe phase
3939

src/panic-implementation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Actually resolving this goes through several layers of indirection:
2828

2929
1. In `compiler/rustc_middle/src/middle/weak_lang_items.rs`, `panic_impl` is
3030
declared as 'weak lang item', with the symbol `rust_begin_unwind`. This is
31-
used in `rustc_typeck/src/collect.rs` to set the actual symbol name to
31+
used in `rustc_hir_analysis/src/collect.rs` to set the actual symbol name to
3232
`rust_begin_unwind`.
3333

3434
Note that `panic_impl` is declared in an `extern "Rust"` block,

src/ty.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ expected type. The [`astconv` module][astconv] is where the code responsible for
7878
but also in other parts of the compiler that want to ask questions like "what argument types does
7979
this function expect?"
8080

81-
[astconv]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/astconv/index.html
81+
[astconv]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_analysis/astconv/index.html
8282

8383
**How semantics drive the two instances of `Ty`**
8484

0 commit comments

Comments
 (0)