]> git.lizzy.rs Git - rust.git/commitdiff
Fix comments about unique borrows
authorLeSeulArtichaut <leseulartichaut@gmail.com>
Sun, 4 Jul 2021 01:34:08 +0000 (03:34 +0200)
committerLeSeulArtichaut <leseulartichaut@gmail.com>
Sun, 4 Jul 2021 01:34:08 +0000 (03:34 +0200)
compiler/rustc_middle/src/mir/mod.rs
compiler/rustc_middle/src/ty/closure.rs

index 672686410f9bfcb3e4dc8382a2b44dff7ec957f0..ed813c054c2636d29121799b78211fc854223dd4 100644 (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; }
index 0706a057dd0c6d6d335989d6ce9663e1ab85b18d..b0156daf17effd53b59b8b5aca1861a6cfe8c82f 100644 (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; }