From 5920d945633c1419c0372968e4c0356ff63b3c91 Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Sun, 4 Feb 2018 21:51:10 -0600 Subject: [PATCH] Update link text --- src/type-inference.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/type-inference.md b/src/type-inference.md index 327bd530..c4307ce7 100644 --- a/src/type-inference.md +++ b/src/type-inference.md @@ -29,15 +29,15 @@ tcx.infer_ctxt().enter(|infcx| { Each inference context creates a short-lived type arena to store the fresh types and things that it will create, as described in the -[README in the `ty` module][ty-readme]. This arena is created by the `enter` +[chapter on the `ty` module][ty-ch]. This arena is created by the `enter` function and disposed of after it returns. -[ty-readme]: ty.html +[ty-ch]: ty.html Within the closure, `infcx` has the type `InferCtxt<'cx, 'gcx, 'tcx>` for some fresh `'cx` and `'tcx` – the latter corresponds to the lifetime of this temporary arena, and the `'cx` is the lifetime of the `InferCtxt` itself. -(Again, see the [`ty` README][ty-readme] for more details on this setup.) +(Again, see the [`ty` chapter][ty-ch] for more details on this setup.) The `tcx.infer_ctxt` method actually returns a build, which means there are some kinds of configuration you can do before the `infcx` is @@ -104,9 +104,9 @@ side-effects of constraining type variables and so forth. However, the actual return type is not `()`, but rather `InferOk<()>`. The `InferOk` type is used to carry extra trait obligations – your job is to ensure that these are fulfilled (typically by enrolling them in a -fulfillment context). See the [trait README] for more background on that. +fulfillment context). See the [trait chapter] for more background on that. -[trait README]: trait-resolution.html +[trait chapter]: trait-resolution.html You can similarly enforce subtyping through `infcx.at(..).sub(..)`. The same basic concepts as above apply.