update description of 'ByRef' borrows of closures

This commit is contained in:
Youngsuk_Kim 2020-09-25 17:39:17 -04:00 committed by Joshua Nelson
parent a0958b664c
commit 06fdc4321e
1 changed files with 3 additions and 3 deletions

View File

@ -183,10 +183,10 @@ 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
`shared`, `shallow`, `unique` or `mut` as defined in the
[`compiler/rustc_middle/src/mir/mod.rs`][mir_mod].
`ImmBorrow`, `UniqueImmBorrow`, `MutBorrow` as defined in the
[`compiler/rustc_middle/src/ty/mod.rs`][middle_ty].
[mir_mod]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/index.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):
**consume** for *move* of a variable, **borrow** for a *borrow* of some kind