-
Notifications
You must be signed in to change notification settings - Fork 125
Open
Description
Currently, it appears that Verus does not "know" the semantics of integer type conversions that change the signedness of the argument, or its size (either truncating or expanding the representation.) Verus currently issues a "truncating warning", and nothing can be proven about the result of the conversion.
Rust Reference 8.2.4 says that these conversions are well-defined, so they should be supported. They are also common in cryptographic code.
The work could be broken down into several PR's. For example.
- Same size, changing sign (e.g. i32 <-> u32 and so on)
- Expanding, same sign (e.g. u8 -> u16, i16 -> i32)
- Truncating, same sign (e.g. u16 -> u8, i32 -> i16)
- Expanding, mixed signedness (e.g. i8 -> u16, u16 -> i32)
- Truncating, mixed signedness (e.h. u32 -> i8, i16 -> u8)
Did I miss any cases?
Metadata
Metadata
Assignees
Labels
No labels