You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users should be able to annotate their unsafe functions with safety conditions and to differentiate between safety and panic freedom / correctness properties.
For example, the Index function index and the slice get_unchecked have the same pre-conditions, however, violating these conditions have very different consequences. Many users of index rely on the fact that it will panic if their assumptions about the index is incorrect. Thus, their contracts should reflect this difference.
The text was updated successfully, but these errors were encountered:
celinval
changed the title
Modify its contract annotation to allow users to specify safety contract separate from correctness / panic freedom. Safety contract should only be accepted in unsafe funtions.
Separate safety contract from correctness / panic freedom
Oct 3, 2024
Users should be able to annotate their unsafe functions with safety conditions and to differentiate between safety and panic freedom / correctness properties.
For example, the Index function
index
and the sliceget_unchecked
have the same pre-conditions, however, violating these conditions have very different consequences. Many users of index rely on the fact that it will panic if their assumptions about the index is incorrect. Thus, their contracts should reflect this difference.The text was updated successfully, but these errors were encountered: