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

JS also supports fallible ctors #762

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

Manishearth
Copy link
Contributor

No description provided.

@@ -40,7 +40,7 @@ pub mod ffi {
Err(())
}

#[diplomat::attr(all(*, supports = fallible_constructors), named_constructor = "failing_struct")]
#[diplomat::attr(all(supports = named_constructors, supports = fallible_constructors), named_constructor = "failing_struct")]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

thought: we should support auto inside toplevel all even if we don't support it inside any

Copy link
Member

@ambiguousname ambiguousname left a comment

Choose a reason for hiding this comment

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

This looks good. Adding a test to verify would be in order, but I'm fairly confident existing code is able to handle fallible constructors

Edit: Missed the new test. Looks good!

@Manishearth Manishearth merged commit c94ac61 into rust-diplomat:main Jan 15, 2025
20 checks passed
@Manishearth Manishearth deleted the js-fallible branch January 15, 2025 02:32
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.

2 participants