intro.ps
mm0.ps
mm.ps
+bck-lifetimes.ps
*.1
+*.txt.eps
slides.pdf
slides.ps
SLIDES+= mm0
SLIDES+= mm
+SLIDES+= bck-lifetimes
+
SLIDEFILES=$(addsuffix .ps, $(SLIDES))
o= >$@.new && mv -f $@.new $@
iconv <$< >$@.1 -f UTF-8 -t ISO-8859-1
LC_CTYPE=en_GB fig2dev -L ps -l dummy -z A4 -D-60 <$@.1 $o
+bck-lifetimes.ps: bck-err.txt.eps
+
%.eps: %.fig
iconv <$< >$@.1 -f UTF-8 -t ISO-8859-1
# wtf!
--- /dev/null
+1 | fn longest(x: &str, y: &str) -> &str {
+ | ^ expected lifetime parameter
+ |
+ = help: this function's return type contains a borrowed value, but the
+signature does not say whether it is borrowed from `x` or `y`
--- /dev/null
+#FIG 3.2 Produced by xfig version 3.2.6a
+Landscape
+Center
+Metric
+A4
+100.00
+Single
+-2
+1200 2
+1 3 0 2 4 7 60 -1 -1 0.000 1 0.0000 2478 3757 611 611 2478 3757 1887 3600
+1 3 0 2 1 7 60 -1 -1 0.000 1 0.0000 4460 3733 385 385 4460 3733 4168 3482
+1 3 0 2 1 7 60 -1 -1 0.000 1 0.0000 7755 3761 385 385 7755 3761 7463 3510
+1 3 0 2 1 7 60 -1 -1 0.000 1 0.0000 6179 4264 385 385 6179 4264 5887 4013
+2 5 0 1 0 -1 60 -1 -1 0.000 0 0 -1 0 0 5
+ 0 bck-err.txt.eps
+ -900 -90 11250 -90 11250 1319 -900 1319 -900 -90
+2 1 0 2 0 7 60 -1 -1 0.000 0 0 -1 0 0 2
+ -1080 1620 11430 1620
+4 0 0 60 -1 12 30 0.0000 4 390 11400 -900 -1800 fn longest(x: &str, y: &str) -> &str {\001
+4 0 0 60 -1 12 30 0.0000 4 390 11700 -900 -1245 if x.len() > y.len() { x } else { y }\001
+4 0 0 60 -1 12 30 0.0000 4 360 300 -900 -690 }\001
+4 0 0 60 -1 12 30 0.0000 4 360 300 -900 5490 }\001
+4 0 0 60 -1 12 30 0.0000 4 390 11700 -900 5040 if x.len() > y.len() { x } else { y }\001
+4 0 0 60 -1 12 30 0.0000 4 360 7800 990 4365 -> &'a str {\001
+4 0 1 60 -1 1 30 0.0000 4 450 3990 4590 3150 lifetime annotations\001
+4 0 4 60 -1 1 30 0.0000 4 450 1650 270 2160 function\001
+4 0 4 60 -1 1 30 0.0000 4 420 2910 270 2610 parameterised\001
+4 0 4 60 -1 1 30 0.0000 4 450 2085 270 3060 by lifetime\001
+4 0 0 60 -1 12 30 0.0000 4 390 11400 -900 3915 fn longest<'a>(x: &'a str, y: &'a str)\001
Single
-2
1200 2
-6 -1350 1125 10800 6300
2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
-1350 1125 10800 1125
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+ -1350 5940 10800 5940
+4 0 0 50 -1 2 36 0.0000 4 420 1200 -1350 -1350 Rust\001
4 0 0 50 -1 2 30 0.0000 4 375 2565 -900 2025 Ian Jackson\001
4 0 0 50 -1 2 30 0.0000 4 330 1275 4050 2025 Citrix\001
4 0 0 50 -1 2 30 0.0000 4 435 2115 5850 2025 May 2019\001
-4 0 0 50 -1 2 30 0.0000 4 330 2505 0 3375 Who am I ?\001
-4 0 0 50 -1 2 30 0.0000 4 435 5655 0 4275 curmudgeon and pessimist\001
-4 0 0 50 -1 2 30 0.0000 4 435 6630 0 5175 Perl, C, Tcl, Python, bash, SQL\001
-4 0 0 50 -1 2 30 0.0000 4 435 10320 0 6075 some C++, Haskell, Ocaml, asm, JS, Lisp, Java...\001
--6
-4 0 0 50 -1 2 30 0.0000 4 435 11925 -1350 -450 The most exciting new programming language for years\001
-4 0 0 50 -1 2 36 0.0000 4 420 1200 -1350 -1350 Rust\001
-4 0 0 50 -1 2 30 0.0000 4 435 3105 900 450 (what, really?)\001
+4 0 0 50 -1 2 30 0.0000 4 435 11925 -1350 -630 The most exciting new programming language for years\001
+4 0 0 50 -1 2 30 0.0000 4 435 3105 900 90 (what, really?)\001
+4 0 0 50 -1 2 30 0.0000 4 435 5655 0 3870 curmudgeon and pessimist\001
+4 0 0 50 -1 2 30 0.0000 4 435 5400 0 4590 Perl, C, Tcl, Python, bash\001
+4 0 0 50 -1 2 30 0.0000 4 330 2505 -450 3240 Who am I ?\001
+4 0 0 50 -1 2 30 0.0000 4 435 10320 0 5310 some C++, Haskell, Ocaml, asm, JS, Lisp, Java...\001
+4 0 0 60 -1 0 20 0.0000 4 300 8715 -990 6570 Some examples taken from the Rust Book etc, Apache 2.0 / MIT\001
Of course nothing is perfect. I'm very critical by nature, so I often
find things to gripe about.
-[ borrow checker error ]
+[ borrow checker error, lifetime example ]
The most obvious difficulty with Rust, if you read the internet, is
some's feeling they are constantly fighting the borrow checker.