aeneas
aeneas copied to clipboard
Unreachable List Loop
use std::borrow::Borrow;
pub enum List<T> {
Cons(T, Box<List<T>>),
Nil,
}
fn foo(v: &List<List<u8>>) -> Option<List<u8>> {
if let List::Cons(h, t) = v {
let mut t = t.borrow();
let mut last = h;
while let List::Cons(ht, tt) = t
{
last = ht;
t = tt.borrow();
}
None
}
else {
None
}
}
Trigger
$ aeneas -backend lean list_cons.llbc [Info ] Imported: list_cons.llbc [Info ] Generated the partial file (because of errors): ./ListCons.lean [Error] Unreachable Source: 'src/main.rs', lines 11:8-18:5