Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usize in const typechecking may be inconsistent with Verus global #1373

Open
tjhance opened this issue Dec 29, 2024 · 1 comment
Open

usize in const typechecking may be inconsistent with Verus global #1373

tjhance opened this issue Dec 29, 2024 · 1 comment

Comments

@tjhance
Copy link
Collaborator

tjhance commented Dec 29, 2024

The theory is that Verus is checking your code for both 32-bit and 64-bit architectures, no matter which machine you're running on.

However, assumptions about your platform can leak into Verus's assumptions:

proof fn test<const X: usize>()
    ensures 0 <= X <= usize::MAX,
{
}

proof fn ensure_is_64_bit()
    ensures usize::MAX == 0xffff_ffff_ffff_ffff,
{
    test::<0xffff_ffff_ffff>();
}
@utaal
Copy link
Collaborator

utaal commented Jan 9, 2025

@tjhance we should coordinate a fix for this that also addresses the const-eval related issues (from 1.79).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants