Skip to content

Commit

Permalink
Explicitly note that :consistent includes no-ub (#49693)
Browse files Browse the repository at this point in the history
* Explicitly note that :consistent includes no-ub

We may split these effects in the future, but currently :consistent-cy
requires the absence for undefined behavior for the function. There
were a few questions about this, so explicitly document this in the
help text.

* Update base/expr.jl

Co-authored-by: Sukera <11753998+Seelengrab@users.noreply.github.com>

---------

Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com>
Co-authored-by: Sukera <11753998+Seelengrab@users.noreply.github.com>
  • Loading branch information
3 people authored May 9, 2023
1 parent 89b47cf commit 61f6082
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions base/expr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,13 @@ The `:consistent` setting asserts that for egal (`===`) inputs:
even for the same world age (e.g. because one ran in the interpreter, while
the other was optimized).
!!! note
The `:consistent`-cy assertion currrently includes the assertion that the function
will not execute any undefined behavior (for any input). Note that undefined behavior
may technically cause the function to violate other effect assertions (such as
`:nothrow` or `:effect_free`) as well, but we do not model this, and all effects
except `:consistent` assume the absence of undefined behavior.
!!! note
If `:consistent` functions terminate by throwing an exception, that exception
itself is not required to meet the egality requirement specified above.
Expand Down

0 comments on commit 61f6082

Please sign in to comment.