Skip to content

Commit 518da21

Browse files
committed
fix a few more links
1 parent 6b25ed2 commit 518da21

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

src/bug-fix-procedure.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ future-compatibility warnings. These are a special category of lint warning.
120120
Adding a new future-compatibility warning can be done as follows.
121121

122122
```rust
123-
// 1. Define the lint in `src/librustc_middle/lint/builtin.rs`:
123+
// 1. Define the lint in `src/librustc/lint/builtin.rs`:
124124
declare_lint! {
125125
pub YOUR_ERROR_HERE,
126126
Warn,
@@ -230,12 +230,14 @@ lint name is mentioned (in the compiler, we use the upper-case name, and a macro
230230
automatically generates the lower-case string; so searching for
231231
`overlapping_inherent_impls` would not find much).
232232

233+
> NOTE: these exact files don't exist anymore, but the procedure is still the same.
234+
233235
#### Remove the lint.
234236

235237
The first reference you will likely find is the lint definition [in
236-
`librustc_middle/lint/builtin.rs` that resembles this][defsource]:
238+
`librustc/lint/builtin.rs` that resembles this][defsource]:
237239

238-
[defsource]: https://github.com/rust-lang/rust/blob/085d71c3efe453863739c1fb68fd9bd1beff214f/src/librustc_middle/lint/builtin.rs#L171-L175
240+
[defsource]: https://github.com/rust-lang/rust/blob/085d71c3efe453863739c1fb68fd9bd1beff214f/src/librustc/lint/builtin.rs#L171-L175
239241

240242
```rust
241243
declare_lint! {
@@ -249,7 +251,7 @@ This `declare_lint!` macro creates the relevant data structures. Remove it. You
249251
will also find that there is a mention of `OVERLAPPING_INHERENT_IMPLS` later in
250252
the file as [part of a `lint_array!`][lintarraysource]; remove it too,
251253

252-
[lintarraysource]: https://github.com/rust-lang/rust/blob/085d71c3efe453863739c1fb68fd9bd1beff214f/src/librustc_middle/lint/builtin.rs#L252-L290
254+
[lintarraysource]: https://github.com/rust-lang/rust/blob/085d71c3efe453863739c1fb68fd9bd1beff214f/src/librustc/lint/builtin.rs#L252-L290
253255

254256
Next, you see see [a reference to `OVERLAPPING_INHERENT_IMPLS` in
255257
`librustc_lint/lib.rs`][futuresource]. This defining the lint as a "future

src/memory.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ types for equality: for each interned type `X`, we implemented [`PartialEq for
1616
X`][peqimpl], so we can just compare pointers. The [`CtxtInterners`] type
1717
contains a bunch of maps of interned types and the arena itself.
1818

19-
[peqimpl]: https://github.com/rust-lang/rust/blob/3ee936378662bd2e74be951d6a7011a95a6bd84d/src/librustc_middle/ty/mod.rs#L528-L534
19+
[peqimpl]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyS.html#implementations
2020
[`CtxtInterners`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.CtxtInterners.html#structfield.arena
2121

2222
### Example: `ty::TyS`

src/ty-fold.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ defined
9393
[here](https://github.com/rust-lang/rust/blob/master/src/librustc_macros/src/type_foldable.rs).
9494

9595
**`subst`** In the case of substitutions the [actual
96-
folder](https://github.com/rust-lang/rust/blob/04e69e4f4234beb4f12cc76dcc53e2cc4247a9be/src/librustc_middle/ty/subst.rs#L467-L482)
96+
folder](https://github.com/rust-lang/rust/blob/75ff3110ac6d8a0259023b83fd20d7ab295f8dd6/src/librustc_middle/ty/subst.rs#L440-L451)
9797
is going to be doing the indexing we’ve already mentioned. There we define a `Folder` and call
9898
`fold_with` on the `TypeFoldable` to process yourself. Then
99-
[fold_ty](https://github.com/rust-lang/rust/blob/04e69e4f4234beb4f12cc76dcc53e2cc4247a9be/src/librustc_middle/ty/subst.rs#L545-L573)
99+
[fold_ty](https://github.com/rust-lang/rust/blob/75ff3110ac6d8a0259023b83fd20d7ab295f8dd6/src/librustc_middle/ty/subst.rs#L512-L536)
100100
the method that process each type it looks for a `ty::Param` and for those it replaces it for
101101
something from the list of substitutions, otherwise recursively process the type. To replace it,
102102
calls
103-
[ty_for_param](https://github.com/rust-lang/rust/blob/04e69e4f4234beb4f12cc76dcc53e2cc4247a9be/src/librustc_middle/ty/subst.rs#L589-L624)
103+
[ty_for_param](https://github.com/rust-lang/rust/blob/75ff3110ac6d8a0259023b83fd20d7ab295f8dd6/src/librustc_middle/ty/subst.rs#L552-L587)
104104
and all that does is index into the list of substitutions with the index of the `Param`.
105105

0 commit comments

Comments
 (0)