From 3329715501ccb1977303f0bc7304853a69874f64 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Mon, 29 Jan 2024 07:44:41 +0900 Subject: [PATCH] Fix some links (#1865) --- CODE_OF_CONDUCT.md | 2 +- src/appendix/background.md | 2 +- src/constants.md | 6 +++--- src/diagnostics.md | 2 +- src/getting-started.md | 2 +- src/identifiers.md | 2 +- src/mir/index.md | 2 +- src/solve/trait-solving.md | 2 +- src/tests/running.md | 2 +- src/traits/canonicalization.md | 8 ++++---- src/ty.md | 22 +++++++++++----------- 11 files changed, 26 insertions(+), 26 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 42f287fbb..04ae046b3 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,3 +1,3 @@ # The Rust Code of Conduct -This repository follows the [Code of Conduct](https://www.rust-lang.org/conduct.html) of the Rust organization. +This repository follows the [Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct) of the Rust organization. diff --git a/src/appendix/background.md b/src/appendix/background.md index 05d01be0f..16456af0a 100644 --- a/src/appendix/background.md +++ b/src/appendix/background.md @@ -310,7 +310,7 @@ does not. ## Books - [Types and Programming Languages](https://www.cis.upenn.edu/~bcpierce/tapl/) - [Programming Language Pragmatics](https://www.cs.rochester.edu/~scott/pragmatics/) -- [Practical Foundations for Programming Languages](https://www.cs.cmu.edu/~rwh/pfpl/2nded.pdf) +- [Practical Foundations for Programming Languages](https://www.cs.cmu.edu/~rwh/pfpl/) - [Compilers: Principles, Techniques, and Tools, 2nd Edition](https://www.pearson.com/us/higher-education/program/Aho-Compilers-Principles-Techniques-and-Tools-2nd-Edition/PGM167067.html) - [Garbage Collection: Algorithms for Automatic Dynamic Memory Management](https://www.cs.kent.ac.uk/people/staff/rej/gcbook/) - [Linkers and Loaders](https://www.amazon.com/Linkers-Kaufmann-Software-Engineering-Programming/dp/1558604960) (There are also free versions of this, but the version we had linked seems to be offline at the moment.) diff --git a/src/constants.md b/src/constants.md index 56d01cc79..d51cffcaf 100644 --- a/src/constants.md +++ b/src/constants.md @@ -1,7 +1,7 @@ # Constants in the type system Constants used in the type system are represented as [`ty::Const`]. -The variants of their [`ty::ConstKind`] mostly mirror the variants of [`ty::TyKind`] +The variants of their [`const_kind::ConstKind`] mostly mirror the variants of [`ty_kind::TyKind`] with the two *additional* variants being `ConstKind::Value` and `ConstKind::Unevaluated`. ## `WithOptConstParam` and dealing with the query system @@ -77,6 +77,6 @@ the constant doesn't use them in any way. This can cause [some interesting errors][pcg-unused-substs] and breaks some already stable code. [`ty::Const`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.Const.html -[`ty::ConstKind`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/sty/enum.ConstKind.html -[`ty::TyKind`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/sty/enum.TyKind.html +[`const_kind::ConstKind`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/const_kind/enum.ConstKind.html +[`ty_kind::TyKind`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/ty_kind/enum.TyKind.html [pcg-unused-substs]: https://github.com/rust-lang/project-const-generics/issues/33 diff --git a/src/diagnostics.md b/src/diagnostics.md index f21bae40f..553f1312d 100644 --- a/src/diagnostics.md +++ b/src/diagnostics.md @@ -689,7 +689,7 @@ declare_lint! { This makes the `ANONYMOUS_PARAMETERS` lint allow-by-default in the 2015 edition but warn-by-default in the 2018 edition. -See [Edition-specific lints](../guides/editions.md#edition-specific-lints) for more information. +See [Edition-specific lints](./guides/editions.md#edition-specific-lints) for more information. ### Feature-gated lints diff --git a/src/getting-started.md b/src/getting-started.md index ef54a3009..bcdd38825 100644 --- a/src/getting-started.md +++ b/src/getting-started.md @@ -15,7 +15,7 @@ chapter on how to build and run the compiler](./building/how-to-build-and-run.md [internals]: https://internals.rust-lang.org [rust-discord]: http://discord.gg/rust-lang [rust-zulip]: https://rust-lang.zulipchat.com -[coc]: https://www.rust-lang.org/conduct.html +[coc]: https://www.rust-lang.org/policies/code-of-conduct [walkthrough]: ./walkthrough.md [Getting Started]: ./getting-started.md diff --git a/src/identifiers.md b/src/identifiers.md index c7e32d04c..627fdd1db 100644 --- a/src/identifiers.md +++ b/src/identifiers.md @@ -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 -[`FieldIdx`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_abi/struct.FieldIdx.html +[`FieldIdx`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_target/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 diff --git a/src/mir/index.md b/src/mir/index.md index 36733c598..94d062c57 100644 --- a/src/mir/index.md +++ b/src/mir/index.md @@ -351,5 +351,5 @@ See the const-eval WG's [docs on promotion](https://github.com/rust-lang/const-e [`ProjectionElem::Deref`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/enum.ProjectionElem.html#variant.Deref [`Rvalue`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/enum.Rvalue.html [`Operand`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/enum.Operand.html -[`mir::Constant`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Constant.html +[`mir::Constant`]: https://doc.rust-lang.org/nightly/nightly-rustc/stable_mir/mir/struct.Constant.html [`ty::Const`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.Const.html diff --git a/src/solve/trait-solving.md b/src/solve/trait-solving.md index 7c1e0b684..34198a407 100644 --- a/src/solve/trait-solving.md +++ b/src/solve/trait-solving.md @@ -43,5 +43,5 @@ For success and ambiguity it also returns constraints inference and region const [`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 +[`CandidateSource`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_trait_selection/traits/solve/enum.CandidateSource.html [`CanonicalResponse`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_trait_selection/traits/solve/type.CanonicalResponse.html diff --git a/src/tests/running.md b/src/tests/running.md index a0c9fb7d0..a4f77aa32 100644 --- a/src/tests/running.md +++ b/src/tests/running.md @@ -352,4 +352,4 @@ $ LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/12/ ./x.py test compiler/rustc_code ``` If you encounter bugs or problems, don't hesitate to open issues on -[rustc_codegen_gcc repository](github.com/rust-lang/rustc_codegen_gcc/). +[rustc_codegen_gcc repository](https://github.com/rust-lang/rustc_codegen_gcc/). diff --git a/src/traits/canonicalization.md b/src/traits/canonicalization.md index 4c7575f62..616636d61 100644 --- a/src/traits/canonicalization.md +++ b/src/traits/canonicalization.md @@ -1,7 +1,7 @@ # Canonicalization > **NOTE**: FIXME: The content of this chapter has some overlap with -> [Next-gen trait solving Canonicalization chapter](../solve/canonicalization.html). +> [Next-gen trait solving Canonicalization chapter](../solve/canonicalization.html). > It is suggested to reorganize these contents in the future. Canonicalization is the process of **isolating** an inference value @@ -46,8 +46,8 @@ This query contains two unbound variables, but it also contains the lifetime `'static`. The trait system generally ignores all lifetimes and treats them equally, so when canonicalizing, we will *also* replace any [free lifetime](../appendix/background.html#free-vs-bound) with a -canonical variable (Note that `'static` is actually a _free_ lifetime -variable here. We are not considering it in the typing context of the whole +canonical variable (Note that `'static` is actually a _free_ lifetime +variable here. We are not considering it in the typing context of the whole program but only in the context of this trait reference. Mathematically, we are not quantifying over the whole program, but only this obligation). Therefore, we get the following result: @@ -106,7 +106,7 @@ Remember that substitution S though! We're going to need it later. OK, now that we have a fresh inference context and an instantiated query, we can go ahead and try to solve it. The trait solver itself is -explained in more detail in [another section](./slg.html), but +explained in more detail in [another section](../solve/the-solver.md), but suffice to say that it will compute a [certainty value][cqqr] (`Proven` or `Ambiguous`) and have side-effects on the inference variables we've created. For example, if there were only one impl of `Foo`, like so: diff --git a/src/ty.md b/src/ty.md index b7a2ba8e4..d595b72fe 100644 --- a/src/ty.md +++ b/src/ty.md @@ -133,7 +133,7 @@ the `ty::Ty` to be a thin pointer-like type. This allows us to do cheap comparisons for equality, along with the other benefits of interning. -[tykind]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/sty/enum.TyKind.html +[tykind]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/ty_kind/enum.TyKind.html ## Allocating and working with types @@ -253,16 +253,16 @@ There are many variants on the `TyKind` enum, which you can see by looking at it - [**And many more**...][kindvars] [wikiadt]: https://en.wikipedia.org/wiki/Algebraic_data_type -[kindadt]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/sty/enum.TyKind.html#variant.Adt -[kindforeign]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/sty/enum.TyKind.html#variant.Foreign -[kindstr]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/sty/enum.TyKind.html#variant.Str -[kindslice]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/sty/enum.TyKind.html#variant.Slice -[kindarray]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/sty/enum.TyKind.html#variant.Array -[kindrawptr]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/sty/enum.TyKind.html#variant.RawPtr -[kindref]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/sty/enum.TyKind.html#variant.Ref -[kindparam]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/sty/enum.TyKind.html#variant.Param -[kinderr]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/sty/enum.TyKind.html#variant.Error -[kindvars]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/sty/enum.TyKind.html#variants +[kindadt]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/ty_kind/enum.TyKind.html#variant.Adt +[kindforeign]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/ty_kind/enum.TyKind.html#variant.Foreign +[kindstr]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/ty_kind/enum.TyKind.html#variant.Str +[kindslice]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/ty_kind/enum.TyKind.html#variant.Slice +[kindarray]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/ty_kind/enum.TyKind.html#variant.Array +[kindrawptr]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/ty_kind/enum.TyKind.html#variant.RawPtr +[kindref]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/ty_kind/enum.TyKind.html#variant.Ref +[kindparam]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/ty_kind/enum.TyKind.html#variant.Param +[kinderr]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/ty_kind/enum.TyKind.html#variant.Error +[kindvars]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/ty_kind/enum.TyKind.html#variants ## Import conventions