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

Add from_fn #227

Closed
wants to merge 1 commit into from
Closed

Add from_fn #227

wants to merge 1 commit into from

Conversation

dspyz-matician
Copy link

Sometimes the compiler fails to infer the type of T in a Lazy. This helps the compiler figure it out from the closure.

@matklad
Copy link
Owner

matklad commented Apr 12, 2023

Hm, I am torn a bit... Ideally, we'd just add this bound to new, like we do for std.

That would be an incompatible change though (the reason why we don't have this bound is that it was impossible until some relatively recent version of Rust)

I don't want to break semver by adding the bound retroactively, but I am also not sure that adding a whole new method here is justified...

@matklad
Copy link
Owner

matklad commented Jun 4, 2023

To not let this hang indefinitely, I decided to close this: to me it seems that smaller API surface outweighs reduced annotation burden.

@matklad matklad closed this Jun 4, 2023
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.

None yet

2 participants