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
The issue is that apparently (according to Ralf), increment is not UB, and thus we can use to Mutex to interiorly mutate the inner field of T.
This means that we should treat all of T as a Cell, and thus actually can't give query an informative specification.
However, this is a big trap: the contract for query is correct, there's no reason we shouldn't be able to use that, and somehow the addition of a separate increment function invalidates that contract.
One issue I have here, is that creusot provides no useful feedback to help you understand the issue, and second, we provide no useful mechanism to specify query (it would be nice to say that its a non-decreasing value).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
@fpoli sent me this example problem which raises some interesting issues about
#[trusted]
and interior mutability:The issue is that apparently (according to Ralf),
increment
is not UB, and thus we can use to Mutex to interiorly mutate theinner
field ofT
.This means that we should treat all of
T
as aCell
, and thus actually can't givequery
an informative specification.However, this is a big trap: the contract for
query
is correct, there's no reason we shouldn't be able to use that, and somehow the addition of a separateincrement
function invalidates that contract.One issue I have here, is that creusot provides no useful feedback to help you understand the issue, and second, we provide no useful mechanism to specify
query
(it would be nice to say that its a non-decreasing value).Beta Was this translation helpful? Give feedback.
All reactions