diff options
| author | David Wood <david@davidtw.co> | 2018-11-04 18:05:54 +0100 |
|---|---|---|
| committer | David Wood <david@davidtw.co> | 2018-11-04 18:05:54 +0100 |
| commit | 1854dde30a56a7fa135ec4f0be435d8de11ff1c1 (patch) | |
| tree | 626caa970b2efb96e1933874253119b67ea768ce | |
| parent | 6d69fe7a2fa31108ee7d23515cec7dd151d08331 (diff) | |
| download | rust-1854dde30a56a7fa135ec4f0be435d8de11ff1c1.tar.gz rust-1854dde30a56a7fa135ec4f0be435d8de11ff1c1.zip | |
Correct indentation on documentation comment.
This commit adjusts the indentation of code within a documentation comment so that it is correctly highlighted as code by rustdoc.
| -rw-r--r-- | src/librustc/mir/mod.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs index c662ed6a6bf..36bc2edcf58 100644 --- a/src/librustc/mir/mod.rs +++ b/src/librustc/mir/mod.rs @@ -506,25 +506,25 @@ pub enum BorrowKind { /// implicit closure bindings. It is needed when the closure is /// borrowing or mutating a mutable referent, e.g.: /// - /// let x: &mut isize = ...; - /// let y = || *x += 5; + /// let x: &mut isize = ...; + /// let y = || *x += 5; /// /// If we were to try to translate this closure into a more explicit /// form, we'd encounter an error with the code as written: /// - /// struct Env { x: & &mut isize } - /// let x: &mut isize = ...; - /// let y = (&mut Env { &x }, fn_ptr); // Closure is pair of env and fn - /// fn fn_ptr(env: &mut Env) { **env.x += 5; } + /// struct Env { x: & &mut isize } + /// let x: &mut isize = ...; + /// let y = (&mut Env { &x }, fn_ptr); // Closure is pair of env and fn + /// fn fn_ptr(env: &mut Env) { **env.x += 5; } /// /// This is then illegal because you cannot mutate an `&mut` found /// in an aliasable location. To solve, you'd have to translate with /// an `&mut` borrow: /// - /// struct Env { x: & &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; } + /// struct Env { x: & &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; } /// /// Now the assignment to `**env.x` is legal, but creating a /// mutable pointer to `x` is not because `x` is not mutable. We |
