Skip to content

Let trait Fill be implemented for element types #1652

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

Merged
merged 5 commits into from
Aug 12, 2025
Merged

Conversation

dhardy
Copy link
Member

@dhardy dhardy commented Aug 7, 2025

  • Added a CHANGELOG.md entry

Summary

This is a simpler variant (no specialization support) of #1651.

Motivation

This trait was added to fill a capability gap: a safe interface for fast filling of slices like [i16]. The impls for [bool], [f32] etc. are extra complexity beyond this and unnecessary since they offer no benefit over element-wise generation in user-code.

@dhardy dhardy requested a review from newpavlov August 7, 2025 07:52
Copy link
Member

@newpavlov newpavlov left a comment

Choose a reason for hiding this comment

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

Looks good to me, but I worry that it may be technically considered a breaking change. It probably should not cause any breakage in practice, so I guess it's fine.

@dhardy dhardy added the B-API Breakage: API label Aug 12, 2025
@dhardy
Copy link
Member Author

dhardy commented Aug 12, 2025

Yes, this is a breaking change. I'd like to start working towards the next rand version now; we may need to make a v0.9 branch.

@dhardy dhardy merged commit ead83fd into master Aug 12, 2025
15 checks passed
@dhardy dhardy deleted the push-nkpwnoqmsurr branch August 12, 2025 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-API Breakage: API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CHANGE: Allow Fill to be implemented for third-party types
2 participants