Skip to content

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

@zjp-CN

Description

@zjp-CN

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions