Skip to content
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

Resolve fully-qualified associated types #905

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

orangeng
Copy link

@orangeng orangeng commented Dec 7, 2023

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

src/bindgen/ir/field.rs Outdated Show resolved Hide resolved
src/bindgen/library.rs Outdated Show resolved Hide resolved
@orangeng orangeng changed the title Added functionality to resolve fully-qualified trait associated types in cbindgen Added functionality to resolve fully-qualified trait associated types in cbindgen. Closes #106 Dec 7, 2023
@orangeng orangeng changed the title Added functionality to resolve fully-qualified trait associated types in cbindgen. Closes #106 Resolve fully-qualified associated types Dec 7, 2023
src/bindgen/parser.rs Outdated Show resolved Hide resolved
src/bindgen/ir/ty.rs Outdated Show resolved Hide resolved
src/bindgen/ir/ty.rs Outdated Show resolved Hide resolved
src/bindgen/parser.rs Outdated Show resolved Hide resolved
src/bindgen/parser.rs Outdated Show resolved Hide resolved
src/bindgen/parser.rs Outdated Show resolved Hide resolved
src/bindgen/parser.rs Outdated Show resolved Hide resolved
src/bindgen/parser.rs Outdated Show resolved Hide resolved
@orangeng orangeng force-pushed the parse-assoc-types branch 2 times, most recently from 2cd1735 to a76a4e8 Compare December 11, 2023 07:27
@mversic
Copy link
Contributor

mversic commented Mar 9, 2024

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

@mversic mversic force-pushed the parse-assoc-types branch from beb281c to 3ff88a9 Compare March 9, 2024 08:50
@mversic mversic force-pushed the parse-assoc-types branch 4 times, most recently from fa24f93 to 2895b55 Compare April 23, 2024 11:49
@mversic
Copy link
Contributor

mversic commented Apr 27, 2024

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

@mversic mversic force-pushed the parse-assoc-types branch 2 times, most recently from c7f64b2 to 5258104 Compare May 17, 2024 20:08
@mversic
Copy link
Contributor

mversic commented May 17, 2024

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

@mversic mversic force-pushed the parse-assoc-types branch 2 times, most recently from 4cd9216 to 862232e Compare June 4, 2024 11:56
@stegaBOB
Copy link

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!

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

Successfully merging this pull request may close these issues.

[ Feature Request ] Resolve trait associated types
3 participants