Hello,
This Rust program triggers an internal compiler error (ICE) when using Creusot:
use creusot_std::prelude::*;
pub fn use_bytes() -> u8 {
b"A"[0]
}
cargo creusot reports:
thread 'rustc' (65308) panicked at creusot/src/backend/term.rs:546:43:
not yet implemented
and there indeed is a todo!() in
|
Literal::Bytes(ref _bytes) => todo!(), |
Using the array notation works (cargo creusot succeeds and manages to proves everything):
use creusot_std::prelude::*;
const A: &[u8] = &[b'A']; // Using b"A" here triggers the ICE
#[ensures(result@ == 0x41)]
pub fn use_bytes() -> u8 {
A[0]
}
(For context, I stumbled upon this while trying to add contracts to crate hex, which uses:
const HEX_CHARS_LOWER: &[u8; 16] = b"0123456789abcdef";
)
Hello,
This Rust program triggers an internal compiler error (ICE) when using Creusot:
cargo creusotreports:and there indeed is a
todo!()increusot/creusot/src/backend/term.rs
Line 546 in 9e8aa17
Using the array notation works (
cargo creusotsucceeds and manages to proves everything):(For context, I stumbled upon this while trying to add contracts to crate
hex, which uses:)