Rollup merge of #86855 - LeSeulArtichaut:patch-1, r=davidtwco

Fix comments about unique borrows
This commit is contained in:
Mara Bos 2021-07-09 16:20:32 +02:00 committed by GitHub
commit e920ef8785
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -651,7 +651,7 @@ pub enum BorrowKind {
/// in an aliasable location. To solve, you'd have to translate with
/// an `&mut` borrow:
///
/// struct Env { x: & &mut isize }
/// struct Env { x: &mut &mut isize }
/// let x: &mut isize = ...;
/// let y = (&mut Env { &mut x }, fn_ptr); // changed from &x to &mut x
/// fn fn_ptr(env: &mut Env) { **env.x += 5; }

View File

@ -347,7 +347,7 @@ pub enum BorrowKind {
/// an `&mut` borrow:
///
/// ```
/// struct Env { x: & &mut isize }
/// struct Env { x: &mut &mut isize }
/// let x: &mut isize = ...;
/// let y = (&mut Env { &mut x }, fn_ptr); // changed from &x to &mut x
/// fn fn_ptr(env: &mut Env) { **env.x += 5; }