Skip to content

Commit 80537ec

Browse files
JOE1994Joshua Nelson
authored and
Joshua Nelson
committed
add link to 'BorrowKind' in closure.md
1 parent 4a9c357 commit 80537ec

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/closure.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,12 @@ shared borrow and another one for a mutable borrow. It will also tell us what wa
181181

182182
The callbacks are defined by implementing the [`Delegate`] trait. The
183183
[`InferBorrowKind`][ibk] type implements `Delegate` and keeps a map that
184-
records for each upvar which mode of borrow was required. The modes of borrow
185-
can be `ByValue` (moved) or `ByRef` (borrowed). For `ByRef` borrows, it can be
186-
`ImmBorrow`, `UniqueImmBorrow`, `MutBorrow` as defined in the
184+
records for each upvar which mode of capture was required. The modes of capture
185+
can be `ByValue` (moved) or `ByRef` (borrowed). For `ByRef` borrows, the possible
186+
[`BorrowKind`][BorrowKind]s are `ImmBorrow`, `UniqueImmBorrow`, `MutBorrow` as defined in the
187187
[`compiler/rustc_middle/src/ty/mod.rs`][middle_ty].
188188

189+
[BorrowKind]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/enum.BorrowKind.html
189190
[middle_ty]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/index.html
190191

191192
`Delegate` defines a few different methods (the different callbacks):

0 commit comments

Comments
 (0)