-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add freeze operator #2941
Comments
@graydon suggests calling it |
My current thoughts on this are that freezing and thawing are kind of unnecessary, but we need to make a few changes to mutability and unique ptrs to make this all work. Right now, mutability for default fields (those without an explicit
You can indeed mutate
then, currently, We also already have the rule that borrowck allows you to borrow the contents of a mutable unique ptr as immutable. That is, we can do something like this:
This works because borrowck will detect and prevent any attempt to modify Anyway, if we did this, then properly designed data structures can be "frozen" and "thawed" in a rather automatic way, just by borrowing and moving them. At least I think they can. I'll write up an example in a gist and post it. |
Here is a gist explaining the idea in a bit more detail: https://gist.github.com/3130874 |
The |
Add a test for rust-lang#2941.
Update ui test crate The main changes: * we don't need to roll our own `status_emitter` anymore * there's only one way to filter now: with the closure passed to `run_tests_generic`
## What's Changed * Rust toolchain upgraded to `nightly-2023-12-14` by @tautschnig and @adpaco-aws **Full Changelog**: model-checking/kani@kani-0.42.0...kani-0.43.0 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses. --------- Signed-off-by: Felipe R. Monteiro <felisous@amazon.com>
It'd be nice to be able to treat things as
const
. Since this involves changing the type, it will probably require language support, although it might be possible to do it with reflection.The text was updated successfully, but these errors were encountered: