-
Notifications
You must be signed in to change notification settings - Fork 71
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
Rustc 1.79.0 #1173
Rustc 1.79.0 #1173
Conversation
@utaal, the freeze issue could be fixed by adding the external specification for Freeze trait in vstd. ziqiaozhou@7e824a2 |
Thank you for the pointer @ziqiaozhou! |
I deleted my prior comment since I was thinking that error was due to other reasons, since the error only happens in a large project where the code may use some new features. The error disappears if I extract that specific chunk of code out. Later on, I realized that it is fixable by const_header_wrapper. To support that in the new macro, I need to change the rewrite similar to the change in syntax.rs. I just lazily set that const_header_wrapper for all spec function calls. I think we can just set it by default no matter whether the function is const or non-const. I also noticed that some macros rely on syntax::rewrite_expr or proof_block or others will need to set is_const: true as default. |
@Chris-Hawblitzel ran veritas and found that my fixes for the new const rules are not sufficient, specifically for this case, from https://github.com/utaal/verified-nrkernel pub exec const x86_arch_exec: ArchExec ensures x86_arch_exec@ == x86_arch_spec {
let layers = [
ArchLayerExec { entry_size: L0_ENTRY_SIZE, num_entries: 512 },
ArchLayerExec { entry_size: L1_ENTRY_SIZE, num_entries: 512 },
ArchLayerExec { entry_size: L2_ENTRY_SIZE, num_entries: 512 },
ArchLayerExec { entry_size: L3_ENTRY_SIZE, num_entries: 512 },
];
assert(x86_arch_spec.layers =~= layers@.map(|n,e:ArchLayerExec| e@));
ArchExec { layers }
} where there is a mix of proof code, which should be allowed to call anything, and exec code which should conform to the const rules. At the moment I don't know how we can address this. |
// Do not actually evaluate consts if we are not compiling, as doing so triggers the | ||
// constness checker, which is more restrictive than necessary for verification. | ||
// Doing this will delay some const-ness errors to when verus is run with `--compile`. | ||
providers.eval_to_const_value_raw = | ||
|_tcx, _key| Ok(rustc_middle::mir::ConstValue::ZeroSized); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Chris-Hawblitzel I did this, which is quite heavy-handed, but seems to work.
This has taken a while but I think it's almost there.
After mergingmain
there's this issue which I think is related to treating the marker trait specially for erasure:(solved, see below)