chiark / gitweb /
wip
[talk-2019-ghm-rust.git] / talk.txt
index 2e5772d43e37b2601de2f8a128e3518145abaecc..3e7f9bbbeb2edee8044c255ac422c1e94ef38f3f 100644 (file)
--- a/talk.txt
+++ b/talk.txt
@@ -55,6 +55,8 @@ many ways this resembles informal notions of object ownership which
 programmers have typically used in C and C++ to make their code
 comprehensible.
 
+[ Borrowing example slide ]  https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#mutable-references
+
 But in Rust the ownership is known to the language, and the rules
 surrounding ownership are enforced by the compiler.  When an object
 ceases to have an owner, it is freed.
@@ -62,21 +64,19 @@ ceases to have an owner, it is freed.
 This ownership system is used not only for dynamically allocated
 objects, but for local variables, and statically allocated objects.
 
-[ Borrowing example slide ]  https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#mutable-references
+[ dangling reference error example  https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#dangling-references ]
 
 To allow an object to be accessed other than through owner, Rust
 formalises the notion of borrowing.  An object can be borrowed by
 writing the ampersand, giving a reference.  The compiler checks that
 the object will outlive the reference.
 
-[ dangling reference error example  https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#dangling-references ]
+[ Borrowing example slide with mut missing ]  ABOVE https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#mutable-references
 
 Borrows (that is, references) come in two kinds: mutable and
 immutable.  You can have many immutable references at once.  A mutable
 reference permits modification, and provides exclusive access.
 
-[ Borrowing example slide with mut missing ]  ABOVE https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#mutable-references
-
 That's what the `mut' is doing in that example.  If you leave it out
 the compiler complains.  This is the Rust `borrow checker' that you
 have may have heard about: the part of the compiler which enforces the