Fix comments about unique borrows
This commit is contained in:
parent
d34a3a401b
commit
88bcd8a25e
2 changed files with 2 additions and 2 deletions
|
@ -651,7 +651,7 @@ pub enum BorrowKind {
|
||||||
/// in an aliasable location. To solve, you'd have to translate with
|
/// in an aliasable location. To solve, you'd have to translate with
|
||||||
/// an `&mut` borrow:
|
/// an `&mut` borrow:
|
||||||
///
|
///
|
||||||
/// struct Env { x: & &mut isize }
|
/// struct Env { x: &mut &mut isize }
|
||||||
/// let x: &mut isize = ...;
|
/// let x: &mut isize = ...;
|
||||||
/// let y = (&mut Env { &mut x }, fn_ptr); // changed from &x to &mut x
|
/// let y = (&mut Env { &mut x }, fn_ptr); // changed from &x to &mut x
|
||||||
/// fn fn_ptr(env: &mut Env) { **env.x += 5; }
|
/// fn fn_ptr(env: &mut Env) { **env.x += 5; }
|
||||||
|
|
|
@ -347,7 +347,7 @@ pub enum BorrowKind {
|
||||||
/// an `&mut` borrow:
|
/// an `&mut` borrow:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// struct Env { x: & &mut isize }
|
/// struct Env { x: &mut &mut isize }
|
||||||
/// let x: &mut isize = ...;
|
/// let x: &mut isize = ...;
|
||||||
/// let y = (&mut Env { &mut x }, fn_ptr); // changed from &x to &mut x
|
/// let y = (&mut Env { &mut x }, fn_ptr); // changed from &x to &mut x
|
||||||
/// fn fn_ptr(env: &mut Env) { **env.x += 5; }
|
/// fn fn_ptr(env: &mut Env) { **env.x += 5; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue