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

Why hiding field of ExtendedGcd? #39

Closed
survived opened this issue Feb 12, 2021 · 3 comments · Fixed by #46
Closed

Why hiding field of ExtendedGcd? #39

survived opened this issue Feb 12, 2021 · 3 comments · Fixed by #46

Comments

@survived
Copy link

Noticed that there's no way to construct ExtendedGcd from user code (because of hidden field), and I can't implement Integer::extended_gcd (as I can't construct being returned structure) and I have to use your generic implementation of egcd. Perhaps there should be ExtendedGcd::new() constructor?

@cuviper
Copy link
Member

cuviper commented Mar 24, 2021

It's just meant as an approximation of the newer #[non_exhaustive] attribute, allowing the possibility of new fields in the future. I'm not sure what else we would want to add though, so maybe we should just remove the hidden field and let it be done.

@survived
Copy link
Author

survived commented Apr 1, 2021

Yep, removing this field makes sense

@tspiteri
Copy link
Contributor

I hit this when trying to implement num_integer::Integer for rug::Integer, and had to use a very ugly hack complete with transmute to create an ExtendedGcd struct.

bors bot added a commit that referenced this issue Mar 21, 2022
46: Remove hidden field from ExtendedGcd r=cuviper a=tspiteri

Fixes #39

Co-authored-by: Trevor Spiteri <[email protected]>
@bors bors bot closed this as completed in 172b0e3 Mar 21, 2022
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 a pull request may close this issue.

3 participants