From 8ad061181d9a819521949517acfff3d4207dea74 Mon Sep 17 00:00:00 2001 From: Ralph Giles Date: Wed, 3 Nov 2010 10:38:34 -0700 Subject: [PATCH 1/4] Fix two documentation typos. --- doc/rust.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/rust.texi b/doc/rust.texi index fed7d9ec6fefd..e7bbb01d25a8c 100644 --- a/doc/rust.texi +++ b/doc/rust.texi @@ -247,7 +247,7 @@ roles. @item Static control over memory allocation, packing and aliasing. Many values in Rust are allocated @emph{within} their containing stack-frame -or parent strucure. Numbers, records, tuples and tags are all allocated this +or parent structure. Numbers, records, tuples and tags are all allocated this way. To allocate such values in the heap, they must be explicitly @emph{boxed}. A @dfn{box} is a pointer to a heap allocation that holds another value, its @emph{content}. If the content of a box is a @emph{state} value -- @@ -1392,7 +1392,7 @@ automatically adjusting reference counts on the associated heap allocation. For these operations, to access the value held in the box requires an explicit dereference of the box value. Explicitly dereferencing a box is indicated with the unary @emph{star} operator @code{*}. Examples of such -@dfn{explicit dererence} operations are: +@dfn{explicit dereference} operations are: @itemize @item copying box values (@code{x = y}) @item passing box values to functions (@code{f(x,y)}) From 7c9bed8b202510b26bcf133ffef5b79cfbad484e Mon Sep 17 00:00:00 2001 From: Ralph Giles Date: Wed, 3 Nov 2010 10:42:51 -0700 Subject: [PATCH 2/4] Make version.texi depend on rust.texi. This will at least update the version string on the title page when the book source changes. It may not be entirely accurate since rust.texi may have uncommitted changes. But previously, it was basically only ever updated on the first build or after 'make clean'. --- doc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Makefile b/doc/Makefile index c1e3f5c1e379e..4d3a7d038dd79 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -2,7 +2,7 @@ DOC_VER := $(shell date +"%Y-%m-%d")-snap all: rust.pdf rust.html -version.texi: Makefile +version.texi: Makefile rust.texi git log -1 \ --format='@macro gitversion%n%h %ci%n@end macro%n' >$@ From f3a0c1f4b04434846a723e5a3dc0ecd7ba6ef730 Mon Sep 17 00:00:00 2001 From: Ralph Giles Date: Wed, 3 Nov 2010 13:55:58 -0700 Subject: [PATCH 3/4] Fix doc references to 'for each' syntax to match the compiler. The rustboot compiler expects 'for each (type v in ...)' like 'for', rather than 'for each (type v = ...)' as given in the documentation. --- doc/rust.texi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/rust.texi b/doc/rust.texi index e7bbb01d25a8c..6ba9d6181460b 100644 --- a/doc/rust.texi +++ b/doc/rust.texi @@ -1845,7 +1845,7 @@ iter range(int lo, int hi) -> int @{ @} let int sum = 0; -for each (int x = range(0,100)) @{ +for each (int x in range(0,100)) @{ sum += x; @} @end example @@ -2325,7 +2325,7 @@ iter range(int x, int y) -> int @{ @} @} -for each (int i = range(5,7)) @{ +for each (int i in range(5,7)) @{ @dots{}; @} @end example @@ -3149,7 +3149,7 @@ fn read_file_lines(&str path) -> vec[str] @{ note path; vec[str] r; file f = open_read(path); - for each (str &s = lines(f)) @{ + for each (str &s in lines(f)) @{ vec.append(r,s); @} ret r; @@ -3282,7 +3282,7 @@ Example of a foreach loop: @example let str txt; let vec[str] lines; -for each (&str s = _str.split(txt, "\n")) @{ +for each (&str s in _str.split(txt, "\n")) @{ vec.push(lines, s); @} @end example From 88762f8e255d3b9d8c67c8a0a2f64b03bc5f9768 Mon Sep 17 00:00:00 2001 From: Ralph Giles Date: Wed, 3 Nov 2010 14:12:30 -0700 Subject: [PATCH 4/4] Fix documentation: it's (&str s) not (str &s). --- doc/rust.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/rust.texi b/doc/rust.texi index 6ba9d6181460b..1576f4f8f5f28 100644 --- a/doc/rust.texi +++ b/doc/rust.texi @@ -3149,7 +3149,7 @@ fn read_file_lines(&str path) -> vec[str] @{ note path; vec[str] r; file f = open_read(path); - for each (str &s in lines(f)) @{ + for each (&str s in lines(f)) @{ vec.append(r,s); @} ret r;