Skip to content

Commit 55fa700

Browse files
catamorphismgraydon
authored andcommitted
---
yaml --- r: 2374 b: refs/heads/master c: d9c9982 h: refs/heads/master v: v3
1 parent 7bdd3e2 commit 55fa700

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 0da33de278593e721ecd430013e3b56e7ce17016
2+
refs/heads/master: d9c9982f0aeb9e6e176007ef5c0490dd18834814

trunk/doc/rust.texi

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,7 @@ The keywords are:
683683
@item @code{auth}
684684
@tab @code{unsafe}
685685
@tab @code{self}
686+
@tab @code{log}
686687
@item @code{bind}
687688
@tab @code{type}
688689
@tab @code{true}
@@ -727,12 +728,12 @@ The keywords are:
727728
@tab @code{while}
728729
@tab @code{break}
729730
@tab @code{cont}
730-
@tab @code{fail}
731-
@item @code{log}
732731
@tab @code{note}
732+
@item @code{assert}
733733
@tab @code{claim}
734734
@tab @code{check}
735735
@tab @code{prove}
736+
@tab @code{fail}
736737
@item @code{for}
737738
@tab @code{each}
738739
@tab @code{ret}
@@ -1395,7 +1396,7 @@ An example of an implicit-dereference operation performed on box values:
13951396
@example
13961397
let @@int x = @@10;
13971398
let @@int y = @@12;
1398-
check (x + y == 22);
1399+
assert (x + y == 22);
13991400
@end example
14001401

14011402
Other operations act on box values as single-word-sized address values,
@@ -1887,7 +1888,7 @@ let counter c = counter(1);
18871888
18881889
c.incr();
18891890
c.incr();
1890-
check (c.get() == 3);
1891+
assert (c.get() == 3);
18911892
@end example
18921893

18931894
There is no @emph{this} or @emph{self} available inside an object's
@@ -2232,9 +2233,9 @@ An example of a tuple type and its use:
22322233
@example
22332234
type pair = tup(int,str);
22342235
let pair p = tup(10,"hello");
2235-
check (p._0 == 10);
2236+
assert (p._0 == 10);
22362237
p._1 = "world";
2237-
check (p._1 == "world");
2238+
assert (p._1 == "world");
22382239
@end example
22392240

22402241

@@ -2898,6 +2899,8 @@ effects of the expression's evaluation.
28982899
* Ref.Expr.Alt:: Expression for complex conditional branching.
28992900
* Ref.Expr.Prove:: Expression for static assertion of typestate.
29002901
* Ref.Expr.Check:: Expression for dynamic assertion of typestate.
2902+
* Ref.Expr.Assert:: Expression for halting the program if a
2903+
boolean condition fails to hold.
29012904
* Ref.Expr.IfCheck:: Expression for dynamic testing of typestate.
29022905
@end menu
29032906

@@ -3068,8 +3071,8 @@ let single_param_fn add4 = bind add(4, _);
30683071
30693072
let single_param_fn add5 = bind add(_, 5);
30703073
3071-
check (add(4,5) == add4(5));
3072-
check (add(4,5) == add5(4));
3074+
assert (add(4,5) == add4(5));
3075+
assert (add(4,5) == add5(4));
30733076
30743077
@end example
30753078

@@ -3592,6 +3595,16 @@ if check even(x) @{
35923595
@}
35933596
@end example
35943597

3598+
@node Ref.Expr.Assert
3599+
@subsection Ref.Expr.Assert
3600+
@c * Ref.Expr.Assert:: Expression that halts the program if a boolean condition fails to hold.
3601+
@cindex Assertions
3602+
3603+
An @code{assert} expression is similar to a @code{check} expression, except
3604+
the condition may be any boolean-typed expression, and the compiler makes no
3605+
use of the knowledge that the condition holds if the program continues to
3606+
execute after the @code{assert}.
3607+
35953608
@page
35963609
@node Ref.Run
35973610
@section Ref.Run

trunk/mk/docs.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ doc/version.texi: $(MKFILES) rust.texi
77
--pretty=format:'@macro gitversion%n%h %ci%n@end macro%n') >$@
88

99
doc/%.pdf: %.texi doc/version.texi
10-
texi2pdf -I doc -o $@ --clean $<
10+
texi2pdf --batch -I doc -o $@ --clean $<
1111

1212
doc/%.html: %.texi doc/version.texi
1313
makeinfo -I doc --html --ifhtml --force --no-split --output=$@ $<

0 commit comments

Comments
 (0)