Open
Description
Triggered by the following:
use prusti_contracts::*;
#[derive(Clone, Copy)]
struct Inner(u32);
#[derive(Clone, Copy)]
struct Outer {
inner: Inner,
}
#[ensures(out.inner === out.inner)]
fn go(out: Outer) {
}
fn main(){}
Yields:
error: [Prusti internal error] Prusti encountered an unexpected internal error
--> min.rs:12:1
|
12 | / fn go(out: Outer) {
13 | | }
| |_^
|
= note: We would appreciate a bug report: https://github.com/viperproject/prusti-dev/issues/new
= note: Details: cannot generate fold-unfold Viper statements. The required permission Pred(old[pre]((unfolding acc(Ref(struct$m_Outer)(_1), write) in _1.f$inner)), read) cannot be obtained.
Some observations:
- The nested struct seems to be part of the problem (changing
inner
to be just au32
allows this to pass) - Changing
ensures
torequires
allows this to pass
I think this is likely related to the old()
expression being introduced.