Skip to content

Commit 0b2c9db

Browse files
authored
Update some links and docs (#1340)
1 parent b389adc commit 0b2c9db

File tree

7 files changed

+26
-25
lines changed

7 files changed

+26
-25
lines changed

Diff for: src/borrow_check/region_inference.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,12 @@ The value of a region can be thought of as a **set**. This set contains all
7878
points in the MIR where the region is valid along with any regions that are
7979
outlived by this region (e.g. if `'a: 'b`, then `end('b)` is in the set for
8080
`'a`); we call the domain of this set a `RegionElement`. In the code, the value
81-
for all regions is maintained in [the
82-
`rustc_mir::borrow_check::nll::region_infer` module][ri]. For each region we
83-
maintain a set storing what elements are present in its value (to make this
81+
for all regions is maintained in [the `rustc_borrowck::region_infer` module][ri].
82+
For each region we maintain a set storing what elements are present in its value (to make this
8483
efficient, we give each kind of element an index, the `RegionElementIndex`, and
8584
use sparse bitsets).
8685

87-
[ri]: https://github.com/rust-lang/rust/tree/master/compiler/rustc_mir/src/borrow_check/region_infer/
86+
[ri]: https://github.com/rust-lang/rust/tree/master/compiler/rustc_borrowck/src/region_infer
8887

8988
The kinds of region elements are as follows:
9089

Diff for: src/building/suggested.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
The full bootstrapping process takes quite a while. Here are some suggestions
44
to make your life easier.
55

6-
## Installing a pre-commit hook
6+
## Installing a pre-push hook
77

88
CI will automatically fail your build if it doesn't pass `tidy`, our
99
internal tool for ensuring code quality. If you'd like, you can install a
1010
[Git hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks)
11-
that will automatically run `./x.py test tidy --bless` on each commit, to ensure
11+
that will automatically run `./x.py test tidy --bless` on each push, to ensure
1212
your code is up to par. If you decide later that this behavior is
13-
undesirable, you can delete the `pre-commit` file in `.git/hooks`.
13+
undesirable, you can delete the `pre-push` file in `.git/hooks`.
1414

15-
A prebuilt git hook lives at [`src/etc/pre-commit.sh`](https://github.com/rust-lang/rust/blob/master/src/etc/pre-commit.sh) which can be copied into your `.git/hooks` folder as `pre-commit` (without the `.sh` extension!).
15+
A prebuilt git hook lives at [`src/etc/pre-push.sh`](https://github.com/rust-lang/rust/blob/master/src/etc/pre-push.sh) which can be copied into your `.git/hooks` folder as `pre-push` (without the `.sh` extension!).
1616

1717
You can also install the hook as a step of running `./x.py setup`!
1818

Diff for: src/contributing.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ where contributors push changes to their personal fork and create pull requests
6767
bring those changes into the source repository. We have more info about how to use git
6868
when contributing to Rust under [the git section](./git.md).
6969

70-
[about-pull-requests]: https://help.github.com/articles/about-pull-requests/
71-
[development-models]: https://help.github.com/articles/about-collaborative-development-models/
70+
[about-pull-requests]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests
71+
[development-models]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/getting-started/about-collaborative-development-models#fork-and-pull-model
7272

7373
### r?
7474

@@ -177,7 +177,7 @@ particularly during rebasing, citing the issue number in the commit can "spam"
177177
the issue in question.
178178

179179
[labeling]: ./rustbot.md#issue-relabeling
180-
[closing-keywords]: https://help.github.com/en/articles/closing-issues-using-keywords
180+
[closing-keywords]: https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
181181

182182
### External Dependencies (subtree)
183183

Diff for: src/git.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ more in depth [book from Git].
1818

1919
[book from Git]: https://git-scm.com/book/en/v2/
2020
[atlassian-git]: https://www.atlassian.com/git/tutorials/what-is-version-control
21-
[documentation]: https://docs.github.com/en/github/getting-started-with-github/set-up-git
21+
[documentation]: https://docs.github.com/en/get-started/quickstart/set-up-git
2222
[guides]: https://guides.github.com/introduction/git-handbook/
2323

2424
## Prerequisites

Diff for: src/macro-expansion.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ only within the macro (i.e. it should not be visible outside the macro).
227227
[code_dir]: https://github.com/rust-lang/rust/tree/master/compiler/rustc_expand/src/mbe
228228
[code_mp]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_expand/mbe/macro_parser
229229
[code_mr]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_expand/mbe/macro_rules
230-
[code_parse_int]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_expand/mbe/macro_parser/fn.parse_tt.html
230+
[code_parse_int]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_expand/mbe/macro_parser/struct.TtParser.html#method.parse_tt
231231
[parsing]: ./the-parser.html
232232
233233
The context is attached to AST nodes. All AST nodes generated by macros have
@@ -503,9 +503,10 @@ The interface of the macro parser is as follows (this is slightly simplified):
503503

504504
```rust,ignore
505505
fn parse_tt(
506-
parser: &mut Cow<Parser>,
507-
ms: &[TokenTree],
508-
) -> NamedParseResult
506+
&mut self,
507+
parser: &mut Cow<'_, Parser<'_>>,
508+
matcher: &[MatcherLoc]
509+
) -> ParseResult
509510
```
510511

511512
We use these items in macro parser:
@@ -515,20 +516,20 @@ We use these items in macro parser:
515516
ask the MBE parser to parse. We will consume the raw stream of tokens and
516517
output a binding of metavariables to corresponding token trees. The parsing
517518
session can be used to report parser errors.
518-
- `ms` a _matcher_. This is a sequence of token trees that we want to match
519-
the token stream against.
519+
- `matcher` is a sequence of `MatcherLoc`s that we want to match
520+
the token stream against. They're converted from token trees before matching.
520521

521522
In the analogy of a regex parser, the token stream is the input and we are matching it
522-
against the pattern `ms`. Using our examples, the token stream could be the stream of
523-
tokens containing the inside of the example invocation `print foo`, while `ms`
523+
against the pattern `matcher`. Using our examples, the token stream could be the stream of
524+
tokens containing the inside of the example invocation `print foo`, while `matcher`
524525
might be the sequence of token (trees) `print $mvar:ident`.
525526

526-
The output of the parser is a `NamedParseResult`, which indicates which of
527+
The output of the parser is a [`ParseResult`], which indicates which of
527528
three cases has occurred:
528529

529-
- Success: the token stream matches the given matcher `ms`, and we have produced a binding
530+
- Success: the token stream matches the given `matcher`, and we have produced a binding
530531
from metavariables to the corresponding token trees.
531-
- Failure: the token stream does not match `ms`. This results in an error message such as
532+
- Failure: the token stream does not match `matcher`. This results in an error message such as
532533
"No rule expected token _blah_".
533534
- Error: some fatal error has occurred _in the parser_. For example, this
534535
happens if there are more than one pattern match, since that indicates
@@ -607,6 +608,7 @@ Because the Rust ABI is unstable, we use the C ABI for this conversion.
607608
[stablets]: https://doc.rust-lang.org/proc_macro/struct.TokenStream.html
608609
[pm]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_expand/proc_macro/index.html
609610
[pms]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_expand/proc_macro_server/index.html
611+
[`ParseResult`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_expand/mbe/macro_parser/enum.ParseResult.html
610612

611613
TODO: more here. [#1160](https://github.com/rust-lang/rustc-dev-guide/issues/1160)
612614

Diff for: src/query.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ will in turn demand information about that crate, starting from the
3737
actual parsing.
3838

3939
Although this vision is not fully realized, large sections of the
40-
compiler (for example, generating [MIR](./mir/)) currently work exactly like this.
40+
compiler (for example, generating [MIR](./mir/index.md)) currently work exactly like this.
4141

4242
[^incr-comp-detail]: The ["Incremental Compilation in Detail](queries/incremental-compilation-in-detail.md) chapter gives a more
4343
in-depth description of what queries are and how they work.

Diff for: src/tests/running.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ See [Compare modes](compiletest.md#compare-modes) for more details.
211211

212212
Sometimes it's easier and faster to just run the test by hand.
213213
Most tests are just `rs` files, so after
214-
[creating a rustup toolchain](/building/how-to-build-and-run.html#creating-a-rustup-toolchain),
214+
[creating a rustup toolchain](../building/how-to-build-and-run.md#creating-a-rustup-toolchain),
215215
you can do something like:
216216

217217
```bash

0 commit comments

Comments
 (0)