提交 88bcd8a2 编写于 作者: L LeSeulArtichaut

Fix comments about unique borrows

上级 d34a3a40
......@@ -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; }
......
......@@ -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; }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册