Skip to content

Commit 10d40c5

Browse files
Introducing init/uninit before its use (#355)
1 parent eaa3a92 commit 10d40c5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/checked-uninit.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ fn main() {
1818
```
1919

2020
This is based off of a basic branch analysis: every branch must assign a value
21-
to `x` before it is first used. Interestingly, Rust doesn't require the variable
21+
to `x` before it is first used. For short, we also say that "`x` is init" or
22+
"`x` is uninit".
23+
24+
Interestingly, Rust doesn't require the variable
2225
to be mutable to perform a delayed initialization if every branch assigns
2326
exactly once. However the analysis does not take advantage of constant analysis
2427
or anything like that. So this compiles:

0 commit comments

Comments
 (0)