Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some links #1705

Merged
merged 2 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bug-fix-procedure.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ self.tcx.sess.add_lint(lint::builtin::OVERLAPPING_INHERENT_IMPLS,
We want to convert this into an error. In some cases, there may be an
existing error for this scenario. In others, we will need to allocate a
fresh diagnostic code. [Instructions for allocating a fresh diagnostic
code can be found here.](./diagnostics/diagnostic-codes.md) You may want
code can be found here.](./diagnostics/error-codes.md) You may want
to mention in the extended description that the compiler behavior
changed on this point, and include a reference to the tracking issue for
the change.
Expand Down
4 changes: 2 additions & 2 deletions src/building/how-to-build-and-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ and `src/tools` directories. So, you can simply run `x.py test tidy` instead of

[rust-analyzer]: suggested.html#configuring-rust-analyzer-for-rustc

See the chapters on [building](how-to-build-and-run),
[testing](../tests/intro), and [rustdoc](../rustdoc) for more details.
See the chapters on
[testing](../tests/running.md) and [rustdoc](../rustdoc.md) for more details.

### Building the compiler

Expand Down
4 changes: 2 additions & 2 deletions src/building/suggested.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ opened when this file is detected.

If you're running `coc.nvim`, you can use `:CocLocalConfig` to create a
`.vim/coc-settings.json` and copy the settings from
[this file](/~https://github.com/rust-lang/rust/blob/master/src/etc/vscode_settings.json).
[this file](/~https://github.com/rust-lang/rust/blob/master/src/etc/rust_analyzer_settings.json).

Another way is without a plugin, and creating your own logic in your configuration. To do this you
must translate the JSON to Lua yourself. The translation is 1:1 and fairly straight-forward. It
Expand Down Expand Up @@ -348,4 +348,4 @@ Zsh support will also be included once issues with [`clap_complete`](https://cra
You can use `source ./src/etc/completions/x.py.<extension>`
to load completions for your shell of choice,
or `source .\src\etc\completions\x.py.ps1` for PowerShell.
Adding this to your shell's startup script (e.g. `.bashrc`) will automatically load this completion.
Adding this to your shell's startup script (e.g. `.bashrc`) will automatically load this completion.
4 changes: 2 additions & 2 deletions src/closure.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ Let's start with defining a term that we will be using quite a bit in the rest o
*upvar*. An **upvar** is a variable that is local to the function where the closure is defined. So,
in the above examples, **x** will be an upvar to the closure. They are also sometimes referred to as
the *free variables* meaning they are not bound to the context of the closure.
[`compiler/rustc_middle/src/ty/query/mod.rs`][upvars] defines a query called *upvars_mentioned*
[`compiler/rustc_passes/src/upvars.rs`][upvars] defines a query called *upvars_mentioned*
for this purpose.

[upvars]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_query_impl/queries/struct.upvars_mentioned.html
[upvars]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_passes/upvars/index.html

Other than lazy invocation, one other thing that distinguishes a closure from a
normal function is that it can use the upvars. It borrows these upvars from its surrounding
Expand Down
3 changes: 0 additions & 3 deletions src/compiler-src.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,8 @@ These include:
run a lot of tests on a lot of platforms.
- [`src/doc`]: Various documentation, including submodules for a few books.
- [`src/etc`]: Miscellaneous utilities.
- [`src/tools/rustc-workspace-hack`], and others: Various workarounds to make
cargo work with bootstrapping.
- And more...

[`src/ci`]: /~https://github.com/rust-lang/rust/tree/master/src/ci
[`src/doc`]: /~https://github.com/rust-lang/rust/tree/master/src/doc
[`src/etc`]: /~https://github.com/rust-lang/rust/tree/master/src/etc
[`src/tools/rustc-workspace-hack`]: /~https://github.com/rust-lang/rust/tree/master/src/tools/rustc-workspace-hack
2 changes: 2 additions & 0 deletions src/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ below][break]) for some PRs.
[r?]: /~https://github.com/rust-lang/rust/pull/78133#issuecomment-712692371
[#t-release/triage]: https://rust-lang.zulipchat.com/#narrow/stream/242269-t-release.2Ftriage
[break]: #breaking-changes
[crater]: tests/crater.md

### CI

In addition to being reviewed by a human, pull requests are automatically tested
Expand Down
11 changes: 6 additions & 5 deletions src/diagnostics/translation.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ excellent examples of translating messages into different locales and the
information that needs to be provided by the code to do so.

### Compile-time validation and typed identifiers
rustc's Fluent resources for the default locale (`en-US`) are in the
[`compiler/rustc_error_messages/locales/en-US`] directory. Currently, each crate
which defines translatable diagnostics has its own Fluent resource, such as
`parser.ftl` or `typeck.ftl`.
Currently, each crate which defines translatable diagnostics has its own
Fluent resource in a file named `messages.ftl`, such as
[`compiler/rustc_borrowck/messages.ftl`] and
[`compiler/rustc_parse/messages.ftl`].

rustc's `fluent_messages` macro performs compile-time validation of Fluent
resources and generates code to make it easier to refer to Fluent messages in
Expand Down Expand Up @@ -240,5 +240,6 @@ won't fail. Bundle loading can fail if a requested locale is missing, Fluent
files are malformed, or a message is duplicated in multiple resources.

[Fluent]: https://projectfluent.org
[`compiler/rustc_error_messages/locales/en-US`]: /~https://github.com/rust-lang/rust/tree/master/compiler/rustc_error_messages/locales/en-US
[`compiler/rustc_borrowck/messages.ftl`]: /~https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc_borrowck/messages.ftl
[`compiler/rustc_parse/messages.ftl`]: /~https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc_parse/messages.ftl
[`rustc_error_messages::DiagnosticMessage`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_error_messages/enum.DiagnosticMessage.html
4 changes: 2 additions & 2 deletions src/fuzzing.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ project, please read this guide before reporting fuzzer-generated bugs!
If you're not sure whether or not an ICE is a duplicate of one that's already
been reported, please go ahead and report it and link to issues you think might
be related. In general, ICEs on the same line but with different *query stacks*
are usually distinct bugs. For example, [#109020][#109202] and [#109129][#109129]
are usually distinct bugs. For example, [#109020][#109020] and [#109129][#109129]
had similar error messages:

```
Expand Down Expand Up @@ -146,4 +146,4 @@ ICEs that require debug assertions to reproduce should be tagged
[glacier]: /~https://github.com/rust-lang/glacier
[fuzz-rustc]: /~https://github.com/dwrensha/fuzz-rustc
[icemaker]: /~https://github.com/matthiaskrgr/icemaker/
[tree-splicer]: /~https://github.com/langston-barrett/tree-splicer/
[tree-splicer]: /~https://github.com/langston-barrett/tree-splicer/
4 changes: 2 additions & 2 deletions src/identifiers.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ See the [HIR chapter][hir-map] for more detailed information.
- [`Local`] identifies a local variable in a function. Its associated data is in
[`LocalDecl`], which can be retrieved by indexing into [`Body.local_decls`].

- [`Field`] identifies a struct's, union's, or enum variant's field. It is used
- [`FieldIdx`] identifies a struct's, union's, or enum variant's field. It is used
as a "projection" in [`Place`].

- [`SourceScope`] identifies a name scope in the original source code. Used for
Expand All @@ -96,7 +96,7 @@ See the [HIR chapter][hir-map] for more detailed information.
[`Local`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Local.html
[`LocalDecl`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.LocalDecl.html
[`Body.local_decls`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Body.html#structfield.local_decls
[`Field`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Field.html
[`FieldIdx`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_abi/struct.FieldIdx.html
[`Place`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Place.html
[`SourceScope`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.SourceScope.html
[`SourceScopeData`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.SourceScopeData.html
Expand Down
2 changes: 1 addition & 1 deletion src/llvm-coverage-instrumentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ function--[`bcb_from_bb()`][bcb-from-bb]--to look up a `BasicCoverageBlock` from
[graph-traits]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_data_structures/graph/index.html#traits
[mir-dev-guide]: mir/index.md
[compute-basic-coverage-blocks]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/coverage/graph/struct.CoverageGraph.html#method.compute_basic_coverage_blocks
[simplify-cfg]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/simplify/struct.SimplifyCfg.html
[simplify-cfg]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/simplify/enum.SimplifyCfg.html
[rust-lang/rust#78544]: /~https://github.com/rust-lang/rust/issues/78544
[mir-debugging]: mir/debugging.md
[bcb-from-bb]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/coverage/graph/struct.CoverageGraph.html#method.bcb_from_bb
Expand Down
5 changes: 2 additions & 3 deletions src/mir/optimizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ optimizes it, and returns the improved MIR.
4. Implement a new optimization in [`compiler/rustc_mir_transform/src`].
The fastest and easiest way to do this is to

1. pick a small optimization (such as [`no_landing_pads`]) and copy it
1. pick a small optimization (such as [`remove_storage_markers`]) and copy it
to a new file,
2. add your optimization to one of the lists in the
[`run_optimization_passes()`] function,
Expand All @@ -72,8 +72,7 @@ If you have any questions along the way, feel free to ask in

[mir-opt-test-readme]: /~https://github.com/rust-lang/rust/blob/master/tests/mir-opt/README.md
[`compiler/rustc_mir_transform/src`]: /~https://github.com/rust-lang/rust/tree/master/compiler/rustc_mir_transform/src
<!--- TODO: Change NoLandingPads. [#1232](/~https://github.com/rust-lang/rustc-dev-guide/issues/1232) -->
[`no_landing_pads`]: /~https://github.com/rust-lang/rust/blob/master/compiler/rustc_mir_transform/src/no_landing_pads.rs
[`remove_storage_markers`]: /~https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc_mir_transform/src/remove_storage_markers.rs
[`run_optimization_passes()`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/fn.run_optimization_passes.html

## Defining optimization passes
Expand Down
2 changes: 1 addition & 1 deletion src/notification-groups/cleanup-crew.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ are a few:

* The [rust-reduce](/~https://github.com/jethrogb/rust-reduce) tool can try to reduce
code automatically.
* The [C-reduce](https://embed.cs.utah.edu/creduce/) tool also works
* The [C-reduce](https://github.com/csmith-project/creduce) tool also works
on Rust code, though it requires that you start from a single
file. (XXX link to some post explaining how to do it?)
* pnkfelix's [Rust Bug Minimization Patterns] blog post
Expand Down
2 changes: 1 addition & 1 deletion src/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ When the tcx is created, it is given the providers by its creator using
the [`Providers`][providers_struct] struct. This struct is generated by
the macros here, but it is basically a big list of function pointers:

[providers_struct]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/query/struct.Providers.html
[providers_struct]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/query/struct.Providers.html

```rust,ignore
struct Providers {
Expand Down
2 changes: 1 addition & 1 deletion src/rustc-driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ as well as allowing some custom code run after different phases of the compilati


[cb]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/trait.Callbacks.html
[rd_rc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/fn.run_compiler.html
[rd_rc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver_impl/fn.run_compiler.html
[i_rc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/interface/fn.run_compiler.html
[example]: /~https://github.com/rust-lang/rustc-dev-guide/blob/master/examples/rustc-driver-example.rs
[`rustc_interface`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/index.html
Expand Down
2 changes: 2 additions & 0 deletions src/rustdoc-internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ running the Markdown parser. There's also a function in here
(`find_testable_code`) that specifically scans for Rust code blocks so the
test-runner code can find all the doctests in the crate.

[Askama]: https://docs.rs/askama/latest/askama/

### From soup to nuts

(alternate title: ["An unbroken thread that stretches from those first `Cell`s
Expand Down
4 changes: 2 additions & 2 deletions src/solve/trait-solving.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ Two types being equal in the type system must mean that they have the same `Type


[solve]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_trait_selection/solve/index.html
[`Goal`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_trait_selection/solve/struct.Goal.html
[`Goal`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_trait_selection/traits/solve/struct.Goal.html
[`Predicate`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.Predicate.html
[`Candidate`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_trait_selection/solve/assembly/struct.Candidate.html
[`CandidateSource`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_trait_selection/solve/assembly/enum.CandidateSource.html
[`CanonicalResponse`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_trait_selection/solve/type.CanonicalResponse.html
[`CanonicalResponse`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_trait_selection/traits/solve/type.CanonicalResponse.html
2 changes: 1 addition & 1 deletion src/tests/compiletest.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ There is a [`tools.mk`] Makefile which you can include which provides a bunch of
utilities to make it easier to run commands and compare outputs.
Take a look at some of the other tests for some examples on how to get started.

[`tools.mk`]: /~https://github.com/rust-lang/rust/blob/master/tests/run-make-fulldeps/tools.mk
[`tools.mk`]: /~https://github.com/rust-lang/rust/blob/master/tests/run-make/tools.mk
[`tests/run-make`]: /~https://github.com/rust-lang/rust/tree/master/tests/run-make


Expand Down