You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm pretty sure we have similar requests (to do blacklisting / whitelisting based on headers, basically) but can't find them r/n.
This is not always trivial because there are built-in types, etc, and definitely deciding where a type comes from is not always feasible.
For example, it is legal to have the same typedef multiple times in different headers, which one do you choose as the "canonical" one, and how do you decide in a way that doesn't depend on include order? Multiple typedefs are not legal in Rust.
That being said, if you ignore that, we may be able to do something that is good enough for most other things.
We could record, if this flag / config option is set, something like the location of a given cursor for a declaration or definition (you can get to the file name with cursor.location().location().0.name(), and store it in the IR.
Then when we generate types, we'd skip everything if the location doesn't match, for example.
So I think such an option cannot be always 100% sound (per the above), but it should be easy to hack up something and see if it works for you. If it does I'd be happy to land it behind some kind of opt-in flag.
Hi,
Sometimes I want to generate rust code for a whole project with a bunch of headers.
and then I have the following problem:
#include "first.h"
.Now you have the same types in 2 modules.
will it somehow be possible to just replace the includes with
pub use first::*
?Thanks.
The text was updated successfully, but these errors were encountered: