From 49611100bf7e5f51fd110b324e2e510bf09d86d3 Mon Sep 17 00:00:00 2001 From: Youngsuk_Kim Date: Fri, 25 Sep 2020 22:42:13 -0400 Subject: [PATCH] add link to 'BorrowKind' in closure.md --- src/closure.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/closure.md b/src/closure.md index 4e6e69d1..f357eed9 100644 --- a/src/closure.md +++ b/src/closure.md @@ -181,11 +181,12 @@ shared borrow and another one for a mutable borrow. It will also tell us what wa The callbacks are defined by implementing the [`Delegate`] trait. The [`InferBorrowKind`][ibk] type implements `Delegate` and keeps a map that -records for each upvar which mode of borrow was required. The modes of borrow -can be `ByValue` (moved) or `ByRef` (borrowed). For `ByRef` borrows, it can be -`ImmBorrow`, `UniqueImmBorrow`, `MutBorrow` as defined in the +records for each upvar which mode of capture was required. The modes of capture +can be `ByValue` (moved) or `ByRef` (borrowed). For `ByRef` borrows, the possible +[`BorrowKind`][BorrowKind]s are `ImmBorrow`, `UniqueImmBorrow`, `MutBorrow` as defined in the [`compiler/rustc_middle/src/ty/mod.rs`][middle_ty]. +[BorrowKind]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/enum.BorrowKind.html [middle_ty]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/index.html `Delegate` defines a few different methods (the different callbacks):