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

Add precise filtering of which items to translate #316

Merged
merged 10 commits into from
Aug 20, 2024

Conversation

Nadrieril
Copy link
Member

This PR adds a rust implementation of something like the NameMatcher. This makes it possible to precisely filter items precisely, e.g. translate exactly one impl from the standard library. This fixes the issue of --extract-opaque-bodies triggering a slurry of errors. This is still a bit rough but already useful.

Fixes #214

@Nadrieril Nadrieril merged commit 0576bfc into AeneasVerif:main Aug 20, 2024
6 checks passed
@Nadrieril Nadrieril deleted the precise-opaques branch August 20, 2024 09:45
name: String,
generics: Vec<PatTy>,
/// For pretty-printing only: whether this is the name of a trait.
is_trait: bool,
Copy link
Member

@sonmarcho sonmarcho Aug 20, 2024

Choose a reason for hiding this comment

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

It would make sense to also use it for matching I think.
For the Charon-ML side: we should have the same, but should also use it for matching (if true, we can only match a trait impl; if false then no restriction because we can use the syntax without impl ... for ... both for regular impls and trait impls).

Copy link
Member Author

@Nadrieril Nadrieril Aug 20, 2024

Choose a reason for hiding this comment

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

I'm not sure how useful that is: there cannot be a trait with the same name as a type

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, I guess with wildcards there can be 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Actually you're probably right: it may be useless. But I was mostly thinking about consistency/sanity...

@sonmarcho
Copy link
Member

It's super nice to finally have this, thanks :)

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.

Support extracting specific foreign items
2 participants