diff --git a/book.toml b/book.toml index 68340d2d7..097706087 100644 --- a/book.toml +++ b/book.toml @@ -40,7 +40,11 @@ exclude = [ "play\\.rust-lang\\.org", "tomlee\\.co", "marketplace\\.visualstudio\\.com", - "objects\\.githubusercontent\\.com" + "objects\\.githubusercontent\\.com", + # The bug listing URL works only if an user is logged in, otherwise one gets 404. + "github\\.com/issues\\?", + # Handle: connection closed before message completed + "microsoft\\.com/en-us/research/publication/", ] cache-timeout = 86400 warning-policy = "error" diff --git a/src/appendix/code-index.md b/src/appendix/code-index.md index 84bdfc18f..a929be867 100644 --- a/src/appendix/code-index.md +++ b/src/appendix/code-index.md @@ -27,7 +27,7 @@ Item | Kind | Short description | Chapter | `StringReader` | struct | This is the lexer used during parsing. It consumes characters from the raw source code being compiled and produces a series of tokens for use by the rest of the parser | [The parser] | [compiler/rustc_parse/src/lexer/mod.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/lexer/struct.StringReader.html) `rustc_ast::token_stream::TokenStream` | struct | An abstract sequence of tokens, organized into `TokenTree`s | [The parser], [Macro expansion] | [compiler/rustc_ast/src/tokenstream.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/tokenstream/struct.TokenStream.html) `TraitDef` | struct | This struct contains a trait's definition with type information | [The `ty` modules] | [compiler/rustc_middle/src/ty/trait_def.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/trait_def/struct.TraitDef.html) -`TraitRef` | struct | The combination of a trait and its input types (e.g. `P0: Trait`) | [Trait Solving: Goals and Clauses] | [compiler/rustc_middle/src/ty/sty.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TraitRef.html) +`TraitRef` | struct | The combination of a trait and its input types (e.g. `P0: Trait`) | [Trait Solving: Goals and Clauses] | [compiler/rustc_middle/src/ty/sty.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/type.TraitRef.html) `Ty<'tcx>` | struct | This is the internal representation of a type used for type checking | [Type checking] | [compiler/rustc_middle/src/ty/mod.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.Ty.html) `TyCtxt<'tcx>` | struct | The "typing context". This is the central data structure in the compiler. It is the context that you use to perform all manner of queries | [The `ty` modules] | [compiler/rustc_middle/src/ty/context.rs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html) diff --git a/src/backend/implicit-caller-location.md b/src/backend/implicit-caller-location.md index cf100a2e5..17158497d 100644 --- a/src/backend/implicit-caller-location.md +++ b/src/backend/implicit-caller-location.md @@ -64,7 +64,7 @@ reach the first function call in the stack which does *not* have the attribute. Starting at the bottom, we iterate up over stack [`Frame`][const-frame]s in the [`InterpCx::stack`][const-stack], calling -[`InstanceDef::requires_caller_location`][requires-location] on the +[`InstanceKind::requires_caller_location`][requires-location] on the [`Instance`s from each `Frame`][frame-instance]. We stop once we find one that returns `false` and return the span of the *previous* frame which was the "topmost" tracked function. @@ -166,7 +166,7 @@ function: * is not `#[naked]` If the use is valid, we set [`CodegenFnAttrsFlags::TRACK_CALLER`][attrs-flags]. This flag influences -the return value of [`InstanceDef::requires_caller_location`][requires-location] which is in turn +the return value of [`InstanceKind::requires_caller_location`][requires-location] which is in turn used in both const and codegen contexts to ensure correct propagation. ### Traits @@ -267,10 +267,10 @@ to the author and reviewers. [rationale]: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md#rationale [revised design]: https://github.com/rust-lang/rust/issues/47809#issuecomment-443538059 [attrs-flags]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/middle/codegen_fn_attrs/struct.CodegenFnAttrFlags.html#associatedconstant.TRACK_CALLER -[`ReifyShim`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/enum.InstanceDef.html#variant.ReifyShim +[`ReifyShim`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/enum.InstanceKind.html#variant.ReifyShim [`Location`]: https://doc.rust-lang.org/core/panic/struct.Location.html [const-find-closest]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_const_eval/interpret/struct.InterpCx.html#method.find_closest_untracked_caller_location -[requires-location]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/enum.InstanceDef.html#method.requires_caller_location +[requires-location]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/instance/enum.InstanceKind.html#method.requires_caller_location [alloc-location]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_const_eval/interpret/struct.InterpCx.html#method.alloc_caller_location [fcx-location]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_codegen_ssa/mir/struct.FunctionCx.html#structfield.caller_location [const-location-query]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.const_caller_location diff --git a/src/closure.md b/src/closure.md index 786c831ee..dc3ef23ed 100644 --- a/src/closure.md +++ b/src/closure.md @@ -195,7 +195,7 @@ can be `ByValue` (moved) or `ByRef` (borrowed). For `ByRef` borrows, the possibl All of these callbacks have a common argument *cmt* which stands for Category, Mutability and Type and is defined in -[`compiler/rustc_middle/src/middle/mem_categorization.rs`][cmt]. Borrowing from the code +[`compiler/rustc_hir_typeck/src/expr_use_visitor.rs`][cmt]. Borrowing from the code comments, "`cmt` is a complete categorization of a value indicating where it originated and how it is located, as well as the mutability of the memory in which the value is stored". Based on the callback (consume, borrow etc.), we @@ -212,4 +212,4 @@ self.tables [`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 +[cmt]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/expr_use_visitor/index.html diff --git a/src/diagnostics/error-guaranteed.md b/src/diagnostics/error-guaranteed.md index afc70eeb0..d0ff775da 100644 --- a/src/diagnostics/error-guaranteed.md +++ b/src/diagnostics/error-guaranteed.md @@ -30,4 +30,4 @@ Thankfully, in most cases, it should be statically impossible to abuse [errorguar]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/struct.ErrorGuaranteed.html [rerrors]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/index.html -[emit]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/struct.diag.html#method.emit +[emit]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/diagnostic/struct.Diag.html#method.emit diff --git a/src/llvm-coverage-instrumentation.md b/src/llvm-coverage-instrumentation.md index 8c74b2e7f..2a4531d21 100644 --- a/src/llvm-coverage-instrumentation.md +++ b/src/llvm-coverage-instrumentation.md @@ -369,7 +369,7 @@ stored in [`CoverageCounters`]. ### The `CoverageGraph` -The [`CoverageGraph`][coverage-graph] is derived from the MIR (`mir::Body`). +The [`CoverageGraph`][coverage graph] is derived from the MIR (`mir::Body`). ```rust let basic_coverage_blocks = CoverageGraph::from_mir(mir_body); diff --git a/src/mir/construction.md b/src/mir/construction.md index d9f99be03..54eee0025 100644 --- a/src/mir/construction.md +++ b/src/mir/construction.md @@ -145,4 +145,4 @@ case of `enum`s. [THIR]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_build/thir/index.html [`rustc_mir_build::thir::cx::expr`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_build/thir/cx/expr/index.html -[`mir_built`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_build/build/fn.mir_built.html +[`mir_built`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_transform/fn.mir_built.html diff --git a/src/mir/index.md b/src/mir/index.md index 94d062c57..7d7475b17 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/stable_mir/mir/struct.Constant.html +[`mir::Constant`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/enum.Const.html [`ty::Const`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.Const.html diff --git a/src/param_env/param_env_acquisition.md b/src/param_env/param_env_acquisition.md index 744186635..391e56291 100644 --- a/src/param_env/param_env_acquisition.md +++ b/src/param_env/param_env_acquisition.md @@ -13,7 +13,7 @@ In the large majority of cases a `ParamEnv` when required already exists somewhe - During well formedness checking the `WfCheckingCtxt` has a [`param_env` field][wfckctxt_param_env] - The `TypeChecker` used by Mir Typeck has a [`param_env` field][mirtypeck_param_env] - In the next-gen trait solver all `Goal`s have a [`param_env` field][goal_param_env] specifying what environment to prove the goal in -- When editing an existing [`TypeRelation`][typerelation] if it implements `ObligationEmittingRelation` then a [`param_env` method][typerelation_param_env] will be available. +- When editing an existing [`TypeRelation`][typerelation] if it implements `PredicateEmittingRelation` then a [`param_env` method][typerelation_param_env] will be available. Using the `param_env` query to obtain an env is generally done at the start of some kind of analysis and then passed everywhere that a `ParamEnv` is required. For example the type checker will create a `ParamEnv` for the item it is type checking and then pass it around everywhere. @@ -27,11 +27,11 @@ The `ParamEnv` type has a method [`ParamEnv::with_reveal_all_normalized`][with_r [param_env_new]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.ParamEnv.html#method.new [normalize_env_or_error]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_trait_selection/traits/fn.normalize_param_env_or_error.html -[fnctxt_param_env]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/struct.FnCtxt.html#structfield.param_env +[fnctxt_param_env]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/fn_ctxt/struct.FnCtxt.html#structfield.param_env [latectxt_param_env]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/context/struct.LateContext.html#structfield.param_env [wfckctxt_param_env]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_analysis/check/wfcheck/struct.WfCheckingCtxt.html#structfield.param_env -[goal_param_env]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_trait_selection/traits/solve/struct.Goal.html#structfield.param_env -[typerelation_param_env]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/relate/combine/trait.ObligationEmittingRelation.html#tymethod.param_env +[goal_param_env]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/canonical/ir/solve/struct.Goal.html#structfield.param_env +[typerelation_param_env]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/trait.PredicateEmittingRelation.html#tymethod.param_env [typerelation]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/relate/trait.TypeRelation.html [mirtypeck_param_env]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/type_check/struct.TypeChecker.html#structfield.param_env [env_reveal_all_normalized]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.param_env_reveal_all_normalized @@ -40,5 +40,5 @@ The `ParamEnv` type has a method [`ParamEnv::with_reveal_all_normalized`][with_r [env_empty]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.ParamEnv.html#method.empty [reveal]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/traits/enum.Reveal.html [pe]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.ParamEnv.html -[param_env_query]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.param_env -[method_pred_entailment]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_analysis/check/compare_impl_item/fn.compare_method_predicate_entailment.html \ No newline at end of file +[param_env_query]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_typeck/fn_ctxt/struct.FnCtxt.html#structfield.param_env +[method_pred_entailment]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_analysis/check/compare_impl_item/fn.compare_method_predicate_entailment.html diff --git a/src/profile-guided-optimization.md b/src/profile-guided-optimization.md index 153fd5048..995752b0b 100644 --- a/src/profile-guided-optimization.md +++ b/src/profile-guided-optimization.md @@ -131,7 +131,7 @@ in [run-make tests][rmake-tests] (the relevant tests have `pgo` in their name). There is also a [codegen test][codegen-test] that checks that some expected instrumentation artifacts show up in LLVM IR. -[rmake-tests]: https://github.com/rust-lang/rust/tree/master/tests/run-make-fulldeps +[rmake-tests]: https://github.com/rust-lang/rust/tree/master/tests/run-make [codegen-test]: https://github.com/rust-lang/rust/blob/master/tests/codegen/pgo-instrumentation.rs ## Additional Information diff --git a/src/solve/normalization.md b/src/solve/normalization.md index eaf4e1b11..8858258b5 100644 --- a/src/solve/normalization.md +++ b/src/solve/normalization.md @@ -118,4 +118,4 @@ for deep normalization to the new solver we cannot emulate this behavior. This d for projections with bound variables, sometimes leaving them unnormalized. An approach which also supports projections with bound variables will be even more involved. -[^opaques]: opaque types are currently handled a bit differently. this may change in the future \ No newline at end of file +[^opaques]: opaque types are currently handled a bit differently. this may change in the future diff --git a/src/solve/opaque-types.md b/src/solve/opaque-types.md index fa7dde2e6..d786afecf 100644 --- a/src/solve/opaque-types.md +++ b/src/solve/opaque-types.md @@ -41,7 +41,7 @@ discarding their inferred types at the end, changing the behavior of an opaque t multiple times during coherence: [example][coherence-example] Inside of the defining scope we start by checking whether the type and const arguments of the -opaque are all placeholders: [source](placeholder-ck). If this check is ambiguous, +opaque are all placeholders: [source][placeholder-ck]. If this check is ambiguous, return ambiguity, if it fails, return `Err(NoSolution)`. This check ignores regions which are only checked at the end of borrowck. If it succeeds, continue. diff --git a/src/solve/trait-solving.md b/src/solve/trait-solving.md index 34198a407..345ee0b09 100644 --- a/src/solve/trait-solving.md +++ b/src/solve/trait-solving.md @@ -40,8 +40,8 @@ The trait solver can either return success, ambiguity or an error as a [`Canonic For success and ambiguity it also returns constraints inference and region constraints. [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/traits/solve/struct.Goal.html +[`Goal`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/canonical/ir/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/traits/solve/enum.CandidateSource.html +[`Candidate`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_next_trait_solver/solve/assembly/struct.Candidate.html +[`CandidateSource`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/canonical/ir/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/compiletest.md b/src/tests/compiletest.md index 89b05a91c..1b506d350 100644 --- a/src/tests/compiletest.md +++ b/src/tests/compiletest.md @@ -65,8 +65,6 @@ The following test suites are available, with links for more information: - [`mir-opt`](#mir-opt-tests) — tests for MIR generation - [`run-make`](#run-make-tests) — general purpose tests using Rust programs (or Makefiles (legacy)) -- `run-make-fulldeps` — `run-make` tests which require a linkable build of `rustc`, - or the rust demangler - [`run-pass-valgrind`](#valgrind-tests) — tests run with Valgrind - [`coverage`](#coverage-tests) - tests for coverage instrumentation - [`coverage-run-rustdoc`](#coverage-tests) - coverage tests that also run diff --git a/src/ty-fold.md b/src/ty-fold.md index e8b61abc4..d4d0952fc 100644 --- a/src/ty-fold.md +++ b/src/ty-fold.md @@ -34,7 +34,7 @@ So to reiterate: - `TypeFoldable` is a trait that is implemented by things that embed types. In the case of `subst`, we can see that it is implemented as a `TypeFolder`: -[`ArgFolder`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/generic_args/struct.ArgFolder.html). +[`ArgFolder`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/binder/struct.ArgFolder.html). Looking at its implementation, we see where the actual substitutions are happening. However, you might also notice that the implementation calls this `super_fold_with` method. What is diff --git a/src/ty_module/early_binder.md b/src/ty_module/early_binder.md index 96f57b2bc..087c5b780 100644 --- a/src/ty_module/early_binder.md +++ b/src/ty_module/early_binder.md @@ -54,8 +54,8 @@ If they occur later, that is a compiler bug. [`FieldDef::ty`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.FieldDef.html#method.ty [field_def_ty_src]: https://github.com/rust-lang/rust/blob/44d679b9021f03a79133021b94e6d23e9b55b3ab/compiler/rustc_middle/src/ty/mod.rs#L1421-L1426 -[`EarlyBinder`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.EarlyBinder.html -[`EarlyBinder::instantiate`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.EarlyBinder.html#method.instantiate +[`EarlyBinder`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/type.EarlyBinder.html +[`EarlyBinder::instantiate`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/type.EarlyBinder.html#method.instantiate --- @@ -73,4 +73,4 @@ When constructing a `Ty` to represent the `b` parameter's type we need to get th The `EarlyBinder` type provides an [`instantiate_identity`] function for discharging the binder when you are "already inside of it". This is effectively a more performant version of writing `EarlyBinder::instantiate(GenericArgs::identity_for_item(..))`. Conceptually this discharges the binder by instantiating it with placeholders in the root universe (we will talk about what this means in the next few chapters). In practice though it simply returns the inner value with no modification taking place. [`type_of`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.type_of -[`instantiate_identity`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.EarlyBinder.html#method.instantiate_identity +[`instantiate_identity`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/type.EarlyBinder.html#method.instantiate_identity diff --git a/src/ty_module/instantiating_binders.md b/src/ty_module/instantiating_binders.md index f5e41b0a5..7976c2951 100644 --- a/src/ty_module/instantiating_binders.md +++ b/src/ty_module/instantiating_binders.md @@ -138,8 +138,8 @@ As a concrete example, accessing the signature of a function we are type checkin [ch_placeholders_universes]: ../borrow_check/region_inference/placeholders_and_universes.md [`instantiate_binder_with_fresh_vars`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_trait_selection/infer/struct.InferCtxt.html#method.instantiate_binder_with_fresh_vars [`InferCtxt`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_trait_selection/infer/struct.InferCtxt.html -[`EarlyBinder`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.EarlyBinder.html +[`EarlyBinder`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/type.EarlyBinder.html [`Binder`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/type.Binder.html [`Placeholder`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.Placeholder.html [`Universe`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.UniverseIndex.html -[`BoundVar`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.BoundVar.html \ No newline at end of file +[`BoundVar`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.BoundVar.html