Skip to content

Commit c594158

Browse files
committed
---
yaml --- r: 21218 b: refs/heads/snap-stage3 c: 1d3abf1 h: refs/heads/master v: v3
1 parent 5e18a01 commit c594158

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: e430a699f2c60890d9b86069fd0c68a70ece7120
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 3e52a0acdec93357806771eb04f0f479873a637b
4+
refs/heads/snap-stage3: 1d3abf15f149036cfd0fa939f6393136ffcd1d7f
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/doc/tutorial.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,6 +1859,13 @@ match my_rec {
18591859
}
18601860
~~~~
18611861

1862+
It's unsafe to dereference `b` in the second `log` expression, because `b` is
1863+
a _pointer_ to the inside of `my_rec`, and the assignment statement has
1864+
allocated a new record and assigned `my_rec` to point to it. Thus, the old
1865+
contents of `my_rec` are no longer live, and `b` is dangling at this point.
1866+
The borrow-checking analysis inside the compiler recognizes this situation
1867+
and rejects the program.
1868+
18621869
## Argument passing styles
18631870

18641871
The fact that arguments are conceptually passed by safe reference does

0 commit comments

Comments
 (0)