From 1362c1f83013df94544121d3c1b13b6c66875ff4 Mon Sep 17 00:00:00 2001
From: lcnr <rust@lcnr.de>
Date: Fri, 21 Oct 2022 15:32:32 +0200
Subject: [PATCH 1/2] fix some links

---
 src/closure.md              | 16 ++++++++--------
 src/generics.md             |  4 ++--
 src/method-lookup.md        |  4 ++--
 src/panic-implementation.md |  2 +-
 src/ty.md                   |  2 +-
 5 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/closure.md b/src/closure.md
index b43be3213..1b909686c 100644
--- a/src/closure.md
+++ b/src/closure.md
@@ -135,10 +135,10 @@ appropriate trait: `Fn` trait for immutable borrow, `FnMut` for mutable borrow,
 and `FnOnce` for move semantics.
 
 Most of the code related to the closure is in the
-[`compiler/rustc_typeck/src/check/upvar.rs`][upvar] file and the data structures are
+[`compiler/rustc_hir_typeck/src/upvar.rs`][upvar] file and the data structures are
 declared in the file [`compiler/rustc_middle/src/ty/mod.rs`][ty].
 
-[upvar]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/upvar/index.html
+[upvar]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_analysis/upvar/index.html
 [ty]:https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/index.html
 
 Before we go any further, let's discuss how we can examine the flow of control through the rustc
@@ -146,12 +146,12 @@ codebase. For closures specifically, set the `RUST_LOG` env variable as below an
 output in a file:
 
 ```console
-> RUST_LOG=rustc_typeck::check::upvar rustc +stage1 -Z dump-mir=all \
+> RUST_LOG=rustc_hir_typeck::upvar rustc +stage1 -Z dump-mir=all \
     <.rs file to compile> 2> <file where the output will be dumped>
 ```
 
 This uses the stage1 compiler and enables `debug!` logging for the
-`rustc_typeck::check::upvar` module.
+`rustc_hir_typeck::upvar` module.
 
 The other option is to step through the code using lldb or gdb.
 
@@ -164,7 +164,7 @@ Let's start with [`upvar.rs`][upvar]. This file has something called
 the [`euv::ExprUseVisitor`] which walks the source of the closure and
 invokes a callback for each upvar that is borrowed, mutated, or moved.
 
-[`euv::ExprUseVisitor`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/expr_use_visitor/struct.ExprUseVisitor.html
+[`euv::ExprUseVisitor`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/expr_use_visitor/struct.ExprUseVisitor.html
 
 ```rust
 fn main() {
@@ -210,6 +210,6 @@ self.tables
     .extend(delegate.adjust_upvar_captures);
 ```
 
-[`Delegate`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/expr_use_visitor/trait.Delegate.html
-[ibk]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/upvar/struct.InferBorrowKind.html
-[cmt]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/mem_categorization/index.html
+[`Delegate`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/expr_use_visitor/trait.Delegate.html
+[ibk]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/upvar/struct.InferBorrowKind.html
+[cmt]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/mem_categorization/index.html
diff --git a/src/generics.md b/src/generics.md
index 13549b2fb..0173bee8f 100644
--- a/src/generics.md
+++ b/src/generics.md
@@ -125,7 +125,7 @@ You may have a couple of followup questions…
  `MyStruct`: `Adt(Foo, &[Param(0), Param(1)])`.
 
 **`subst`** How do we actually do the substitutions? There is a function for that too! You use
-[`subst`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/subst/trait.Subst.html) to
+[`subst`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/subst/struct.EarlyBinder.html#method.subst) to
 replace a `SubstRef` with another list of types.
 
 [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
 `type_of` to get a type and call `ty.subst(substs)` to get a new version of `ty` with
 the substitutions made.
 
-[substex]: https://github.com/rust-lang/rust/blob/597f432489f12a3f33419daa039ccef11a12c4fd/src/librustc_typeck/astconv.rs#L942-L953
+[substex]: https://github.com/rust-lang/rust/blob/0940040c0486a536be4f8685c7dd9a078f9e87c2/compiler/rustc_hir_analysis/src/astconv/mod.rs#L1231-L1242
 
 **Note on indices:** It is possible for the indices in `Param` to not match with what we expect. For
 example, the index could be out of bounds or it could be the index of a lifetime when we were
diff --git a/src/method-lookup.md b/src/method-lookup.md
index 8eb8ec5ce..8b49e8d00 100644
--- a/src/method-lookup.md
+++ b/src/method-lookup.md
@@ -32,8 +32,8 @@ inference variables or other information.
 
 [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
 [UFCS]: https://github.com/rust-lang/rfcs/blob/master/text/0132-ufcs.md
-[probe]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/method/probe/
-[confirm]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/method/confirm/
+[probe]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/method/probe/
+[confirm]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/method/confirm/
 
 ## The Probe phase
 
diff --git a/src/panic-implementation.md b/src/panic-implementation.md
index 66e61548e..d1ca202dc 100644
--- a/src/panic-implementation.md
+++ b/src/panic-implementation.md
@@ -28,7 +28,7 @@ Actually resolving this goes through several layers of indirection:
 
 1. In `compiler/rustc_middle/src/middle/weak_lang_items.rs`, `panic_impl` is
    declared as 'weak lang item', with the symbol `rust_begin_unwind`. This is
-   used in `rustc_typeck/src/collect.rs` to set the actual symbol name to
+   used in `rustc_hir_analysis/src/collect.rs` to set the actual symbol name to
    `rust_begin_unwind`.
 
    Note that `panic_impl` is declared in an `extern "Rust"` block,
diff --git a/src/ty.md b/src/ty.md
index 1cc03fce0..9b35f0d4c 100644
--- a/src/ty.md
+++ b/src/ty.md
@@ -78,7 +78,7 @@ expected type. The [`astconv` module][astconv] is where the code responsible for
 but also in other parts of the compiler that want to ask questions like "what argument types does
 this function expect?"
 
-[astconv]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/astconv/index.html
+[astconv]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_analysis/astconv/index.html
 
 **How semantics drive the two instances of `Ty`**
 

From 63c761f37a8f7254699acadc81a728d89ab77dda Mon Sep 17 00:00:00 2001
From: lcnr <rust@lcnr.de>
Date: Sat, 22 Oct 2022 10:54:09 +0200
Subject: [PATCH 2/2] Update src/closure.md

Co-authored-by: Yuki Okushi <jtitor@2k36.org>
---
 src/closure.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/closure.md b/src/closure.md
index 1b909686c..c3906a80b 100644
--- a/src/closure.md
+++ b/src/closure.md
@@ -138,7 +138,7 @@ Most of the code related to the closure is in the
 [`compiler/rustc_hir_typeck/src/upvar.rs`][upvar] file and the data structures are
 declared in the file [`compiler/rustc_middle/src/ty/mod.rs`][ty].
 
-[upvar]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_analysis/upvar/index.html
+[upvar]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/upvar/index.html
 [ty]:https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/index.html
 
 Before we go any further, let's discuss how we can examine the flow of control through the rustc