Skip to content

Commit 4522dc3

Browse files
authored
Control-flow within a function: incorrect example
1 parent 8884ad3 commit 4522dc3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

text/2094-nll.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ problem cases, as well as a number of other interesting examples.
536536
```rust
537537
let mut foo: T = ...;
538538
let mut bar: T = ...;
539-
let p: &T;
539+
let mut p: &T;
540540

541541
p = &foo;
542542
// (0)
@@ -564,7 +564,7 @@ containing a list of discrete statements and a trailing terminator:
564564
```
565565
// let mut foo: i32;
566566
// let mut bar: i32;
567-
// let p: &i32;
567+
// let mut p: &i32;
568568
569569
A
570570
[ p = &foo ]
@@ -608,7 +608,7 @@ are three lifetimes that result. We will call them `'p`, `'foo`, and
608608
```rust
609609
let mut foo: T = ...;
610610
let mut bar: T = ...;
611-
let p: &'p T;
611+
let mut p: &'p T;
612612
// --
613613
p = &'foo foo;
614614
// ----
@@ -691,7 +691,7 @@ important to Example 4:
691691
```rust
692692
let mut foo: T = ...;
693693
let mut bar: T = ...;
694-
let p: &'p T = &foo;
694+
let mut p: &'p T = &foo;
695695
// `p` is live here: its value may be used on the next line.
696696
if condition {
697697
// `p` is live here: its value will be used on the next line.

0 commit comments

Comments
 (0)