linkcheck: fix reported broken links (part 2) (#2024)
* linkcheck: fix reported broken links (part 2) * Apply suggestions from code review Co-authored-by: León Orell Valerian Liehr <me@fmease.dev> * Fix mir::Constant link target * Fix borked links * Fix one more link name * Exclude 2 links from checking * Fix exclude patterns in book.toml * Fix comment * Fix rmake-tests URL * Apply suggestions from code review Co-authored-by: León Orell Valerian Liehr <me@fmease.dev> --------- Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
This commit is contained in:
parent
ab06b10c89
commit
9a13c75f11
|
|
@ -40,7 +40,11 @@ exclude = [
|
||||||
"play\\.rust-lang\\.org",
|
"play\\.rust-lang\\.org",
|
||||||
"tomlee\\.co",
|
"tomlee\\.co",
|
||||||
"marketplace\\.visualstudio\\.com",
|
"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
|
cache-timeout = 86400
|
||||||
warning-policy = "error"
|
warning-policy = "error"
|
||||||
|
|
|
||||||
|
|
@ -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)
|
`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)
|
`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)
|
`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<P1...Pn>`) | [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<P1...Pn>`) | [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)
|
`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)
|
`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)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
Starting at the bottom, we iterate up over stack [`Frame`][const-frame]s in the
|
||||||
[`InterpCx::stack`][const-stack], calling
|
[`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
|
[`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.
|
return the span of the *previous* frame which was the "topmost" tracked function.
|
||||||
|
|
||||||
|
|
@ -166,7 +166,7 @@ function:
|
||||||
* is not `#[naked]`
|
* is not `#[naked]`
|
||||||
|
|
||||||
If the use is valid, we set [`CodegenFnAttrsFlags::TRACK_CALLER`][attrs-flags]. This flag influences
|
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.
|
used in both const and codegen contexts to ensure correct propagation.
|
||||||
|
|
||||||
### Traits
|
### 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
|
[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
|
[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
|
[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
|
[`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
|
[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
|
[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
|
[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
|
[const-location-query]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.const_caller_location
|
||||||
|
|
|
||||||
|
|
@ -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,
|
All of these callbacks have a common argument *cmt* which stands for Category,
|
||||||
Mutability and Type and is defined in
|
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
|
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
|
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
|
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
|
[`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
|
[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
|
||||||
|
|
|
||||||
|
|
@ -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
|
[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
|
[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
|
||||||
|
|
|
||||||
|
|
@ -369,7 +369,7 @@ stored in [`CoverageCounters`].
|
||||||
|
|
||||||
### The `CoverageGraph`
|
### 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
|
```rust
|
||||||
let basic_coverage_blocks = CoverageGraph::from_mir(mir_body);
|
let basic_coverage_blocks = CoverageGraph::from_mir(mir_body);
|
||||||
|
|
|
||||||
|
|
@ -145,4 +145,4 @@ case of `enum`s.
|
||||||
[THIR]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_build/thir/index.html
|
[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
|
[`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
|
||||||
|
|
|
||||||
|
|
@ -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
|
[`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
|
[`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
|
[`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
|
[`ty::Const`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.Const.html
|
||||||
|
|
|
||||||
|
|
@ -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]
|
- 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]
|
- 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
|
- 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.
|
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
|
[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
|
[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
|
[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
|
[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
|
[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/relate/combine/trait.ObligationEmittingRelation.html#tymethod.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
|
[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
|
[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
|
[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
|
[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
|
[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
|
[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
|
[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
|
[method_pred_entailment]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_analysis/check/compare_impl_item/fn.compare_method_predicate_entailment.html
|
||||||
|
|
@ -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
|
There is also a [codegen test][codegen-test] that checks that some expected
|
||||||
instrumentation artifacts show up in LLVM IR.
|
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
|
[codegen-test]: https://github.com/rust-lang/rust/blob/master/tests/codegen/pgo-instrumentation.rs
|
||||||
|
|
||||||
## Additional Information
|
## Additional Information
|
||||||
|
|
|
||||||
|
|
@ -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]
|
multiple times during coherence: [example][coherence-example]
|
||||||
|
|
||||||
Inside of the defining scope we start by checking whether the type and const arguments of the
|
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
|
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.
|
only checked at the end of borrowck. If it succeeds, continue.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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.
|
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
|
[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
|
[`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
|
[`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_trait_selection/traits/solve/enum.CandidateSource.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
|
[`CanonicalResponse`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_trait_selection/traits/solve/type.CanonicalResponse.html
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,6 @@ The following test suites are available, with links for more information:
|
||||||
- [`mir-opt`](#mir-opt-tests) — tests for MIR generation
|
- [`mir-opt`](#mir-opt-tests) — tests for MIR generation
|
||||||
- [`run-make`](#run-make-tests) — general purpose tests using Rust programs (or
|
- [`run-make`](#run-make-tests) — general purpose tests using Rust programs (or
|
||||||
Makefiles (legacy))
|
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
|
- [`run-pass-valgrind`](#valgrind-tests) — tests run with Valgrind
|
||||||
- [`coverage`](#coverage-tests) - tests for coverage instrumentation
|
- [`coverage`](#coverage-tests) - tests for coverage instrumentation
|
||||||
- [`coverage-run-rustdoc`](#coverage-tests) - coverage tests that also run
|
- [`coverage-run-rustdoc`](#coverage-tests) - coverage tests that also run
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ So to reiterate:
|
||||||
- `TypeFoldable` is a trait that is implemented by things that embed types.
|
- `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`:
|
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.
|
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
|
However, you might also notice that the implementation calls this `super_fold_with` method. What is
|
||||||
|
|
|
||||||
|
|
@ -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
|
[`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
|
[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`]: 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/struct.EarlyBinder.html#method.instantiate
|
[`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.
|
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
|
[`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
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ 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
|
[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
|
[`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
|
[`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
|
[`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
|
[`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
|
[`Universe`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.UniverseIndex.html
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue