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

feat(engine): add feature for trait item defaults #824

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

paulmure
Copy link
Contributor

@paulmure paulmure commented Aug 6, 2024

Address #624 in the importer.

This PR adds a TIDefault variant to trait_item' in the AST to support trait items with default values/implementations.

Currently, only defaults in const and fn are supported where consts are encoded with a arity-0 function just like normal trait items.

Defaults for associated types are not currently supported as they are still an unstable feature in upstream rust rust-lang/rust#29661.

This addition is feature gated with the trait_item_default feature and all backends have been adjusted to reject this feature for the moment.

Copy link
Collaborator

@W95Psp W95Psp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! That looks good to me, and that's a good thing to add support for, thanks! 😃

@W95Psp W95Psp added this pull request to the merge queue Aug 6, 2024
Merged via the queue into hacspec:main with commit 533f870 Aug 6, 2024
13 checks passed
@paulmure paulmure deleted the trait-defaults branch August 6, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants