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

Non Prusti specific changes that are helpful for adding Prusi-ish syntax #971

Merged
merged 1 commit into from
Mar 15, 2024

Conversation

dewert99
Copy link
Collaborator

In #932 you mentioned it would be useful to extract out some of the changes I made that are not Prusti specific into there own PR.

I reorganized creusot_contracts adding base_macros which is just a re-export of either creusot_contracts_proc or creusot_contracts_dummy, and prelude which re-exports the items from creusot_contracts but not all the modules so that you can use creusot_contracts::prelude::* instead of use creusot_contracts::*.

I modified the types stored in pearlite Terms so that they match the types from THIR, instead of stripping off boxes and shared references. I also added a creusot_ty method that returns the type with boxes and shared references removed to use in places creusot was relying on this stripping.

Copy link
Collaborator

@xldenis xldenis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified the types stored in pearlite Terms so that they match the types from THIR, instead of stripping off boxes and shared references.

This is something I wanted to do anyways it makes the interpretation of terms well founded.

I think the creusot_ty method is good but longer term I'd like tens to be fully well typed and not elude those references.


#[cfg(not(creusot))]
extern crate creusot_contracts_dummy as base_macros;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Big fan of this '

creusot/src/translation/pearlite.rs Show resolved Hide resolved
@dewert99
Copy link
Collaborator Author

Sorry, when you approve changes do you mean for me to merge them, or do you prefer to do that yourself?

@xldenis
Copy link
Collaborator

xldenis commented Mar 15, 2024

No go ahead and merge yourself.

@dewert99 dewert99 merged commit c22743f into creusot-rs:master Mar 15, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants