Skip to content

Instances from dependency crates are unable to be converted to CrateItem #99

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

Open
zjp-CN opened this issue May 8, 2025 · 1 comment

Comments

@zjp-CN
Copy link

zjp-CN commented May 8, 2025

It's confusing the doc of impl TryFrom<Instance> for CrateItem says "Only user defined instances can be converted", while actually the behavior is like "only local defined instances can be converted".

Full example to demonstrate: Artisan-Lab/tag-std#1

Especially these lines related to this issue:

https://github.com/os-checker/tag-std/blob/9be540e2b237fb7c1cb001b6396034e61ec5b1f4/demo/rustc_driver/src/main.rs#L78-L83


From my observation, it's viable to convert non-user-defined instances like ones from std as stable_mir already does, and can convert more Instances to CrateItems as these lines show. So in any sense, the TryFrom doc description is incorrect.

@celinval
Copy link
Contributor

celinval commented May 8, 2025

I agree. I think this is related to #34. We need a better definition of what crate items actually represent.

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

No branches or pull requests

2 participants