mozilla / cbindgen

A project for generating C bindings from Rust code
Mozilla Public License 2.0
2.37k stars 306 forks source link

Resolve fully-qualified associated types #905

Open orangeng opened 10 months ago

orangeng commented 10 months ago

In the parsing stage, the functionality of the syn::Impl parsing is extended to keep track of associated type implementations in trait Impls.

This info is kept in a hash-map, where the key is a combination of (self type, trait name, associated type name) and the value is the concrete type itself.

In the library/transformation stage, this populated hashmap is then referenced to resolve associated types found.

Closes #106

mversic commented 7 months ago

@emilio can we move this to completion? it's a great feature? @orangeng can you fix the lints?

mversic commented 5 months ago

@emilio is there something blocking the merge of this feature?

mversic commented 4 months ago

@emilio do you think we can get this PR merged soon?

stegaBOB commented 3 months ago

We're currently using this in prod. Would love to get this merged in! Without this PR out entire cbindgen flow wouldn't work. Thanks @orangeng for your awesome contribution!