Skip to content

Commit 8c757fc

Browse files
committed
Clarify docs about claim
1 parent 5059c5f commit 8c757fc

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

doc/rust.texi

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3641,14 +3641,12 @@ that is not actually checked at runtime. Thus, using a @code{claim} implies a
36413641
proof obligation to ensure---without compiler assistance---that an assertion
36423642
always holds.
36433643

3644-
With a command-line flag, the compiler can turn all @code{claim} expressions
3645-
into @code{check} expressions, but the default is to not check the assertion
3646-
contained in a @code{claim}.
3647-
3648-
The idea is to use @code{check} during development, with @code{claim}
3649-
providing the freedom to disable a few runtime checks in performance-critical
3650-
locations once code is debugged, while leaving the @code{claim} expressions in
3651-
the code as documentation.
3644+
Setting a runtime flag can turn all @code{claim} expressions
3645+
into @code{check} expressions in a compiled Rust program, but the default is to not check the assertion
3646+
contained in a @code{claim}. The idea behind @code{claim} is that performance profiling might identify a
3647+
few bottlenecks in the code where actually checking a given callee's predicate
3648+
is too expensive; @code{claim} allows the code to typecheck without removing
3649+
the predicate check at every other call site.
36523650

36533651
@node Ref.Expr.IfCheck
36543652
@subsection Ref.Expr.IfCheck

0 commit comments

Comments
 (0)