-
Notifications
You must be signed in to change notification settings - Fork 13
Add more information for ForeignDef
#61
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
Comments
Do you mean adding |
That's right. |
@oli-obk wondering if you know what kind of information users get from the ForeignDef besides name? I couldn't find any other use case in MIRI, rustc codegen or Kani. I am tempted to just have a simple ForeignItemKind enum for now to provide the kind. |
Yea, you can't obtain more than the kind (and thus information like a static's type or a function's signature). Not sure that information is useful to anyone, as you can't rely on the other end of the foreign item to actually match |
In theory, I think it would make sense for kind to be: enum ForeignItemKind {
Fn(FnDef),
Static(StaticDef),
Ty(Ty),
} That said, we would need to ensure all the methods of |
The same happens for
But it means that |
|
I believe |
@rustbot claim |
…i-obk Add APIs for fetching foreign items Closes rust-lang/project-stable-mir#61
Rollup merge of rust-lang#120982 - momvart:smir-61-foreign_kind, r=oli-obk Add APIs for fetching foreign items Closes rust-lang/project-stable-mir#61
ForeignDef
items may correspond to functions, statics, or types. Based onrustc_hir::ForeignItem
, we need an equivalent ofForeignItemKind
.For these variants:
Fn
: CanFnDef
be reused?Static
: The existing information onCrateDef
should be enough.Ty
: Not sure if it is stable yet (#rust/43467)Similar to existing kind types, the following changes are expected:
foreign_item_kind
toContext
kind
toFnDef
calling the method aboveThe text was updated successfully, but these errors were encountered: