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

Support extracting specific foreign items #214

Closed
Nadrieril opened this issue May 30, 2024 · 2 comments · Fixed by #316
Closed

Support extracting specific foreign items #214

Nadrieril opened this issue May 30, 2024 · 2 comments · Fixed by #316
Assignees

Comments

@Nadrieril
Copy link
Member

Nadrieril commented May 30, 2024

--extract-opaque-bodies extracts all the foreign definitions it can. It would be useful to be able to specify only specific ones. E.g. in Charon.toml:

[charon]
extract = [
  "trait core::convert::Into",
  "fn core::convert::{impl core::convert::Into<@U> for @T}::into",
]

This would extract the Into trait and the blanket From => Into implementation, which could be useful if the crate defines any From impls.

@msprotz
Copy link
Contributor

msprotz commented Aug 2, 2024

FYI I tried this just now and I got this:

[Charon__GAstOfJson.type_decl_kind_of_json] failed on: `Assoc ([("Error",
          `String ("Unsupported type: foreign type: core::fmt::rt::{extern#0}::Opaque"))
          ])

to reproduce, add --extract-opaque-bodies to $(CHARON) in eurydice/Makefile, then run make test-where_clauses_closure.

@Nadrieril
Copy link
Member Author

Nadrieril commented Aug 19, 2024

With #316, charon --include "core::convert::{impl core::convert::Into<_> for _}::into" will translate precisely the requested method. This avoids the issue of --extract-opaque-bodies extracting too much.

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 a pull request may close this issue.

2 participants